
public class scene2 : MonoBehaviour
{
public GameObject[] lvl;
public int rot;
public GameObject posit;
private GameObject player;
private void Start()
{
player = GameObject.FindWithTag("Player");
}
private void OnTriggerEnter(Collider other)
{
Vector3 bbb = posit.transform.position;
if (lvl != null && lvl.Length > 0)
{
int a = player.GetComponent().loop;
int rand = Random.Range(0, lvl.Length);
Instantiate(lvl[rand], bbb, Quaternion.Euler(0, rot*a, 0));
transform.position = posit.transform.position;
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... he-game-ar
Мобильная версия