Пример #1
0
    private void Start()
    {
        rooms  = GameObject.FindGameObjectWithTag("DirectionArrays").GetComponent <DirectionArrays>();
        random = Random.Range(0, 4);

        if (direction != directionSpawn.middle)
        {
            Invoke("Spawn", 0.1f);
        }
    }
Пример #2
0
    private void Start()
    {
        itemList = GameObject.FindGameObjectWithTag("DirectionArrays").GetComponent <DirectionArrays>();
        int random = Random.Range(0, itemList.items.Count);

        GameObject newItem = Instantiate(itemList.items[random], transform.parent);

        newItem.transform.position = transform.position;

        Destroy(gameObject);
    }