20 lines
472 B
C#
20 lines
472 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SpawnScanner : MonoBehaviour
|
|
{
|
|
[SerializeField] private GameObject platform;
|
|
private void OnTriggerExit2D(Collider2D collision)
|
|
{
|
|
Spawn();
|
|
}
|
|
|
|
private void Spawn()
|
|
{
|
|
float height = Random.Range(-2f, -1f);
|
|
Vector3 positionPLat = new Vector3(12f, height, 0f);
|
|
Instantiate(platform, positionPLat, Quaternion.identity);
|
|
}
|
|
}
|