void Start() { _npc = GetComponent <NavMeshAgent>(); _npcTrans = GetComponent <Transform>(); _npc.SetDestination(Random.insideUnitSphere * 100); cityManager = GameObject.Find("Game Manager").GetComponent <City_Manager>(); }
void Start() { cityManager = GameObject.Find("Game Manager").GetComponent <City_Manager>(); for (int i = 0; i < maxHeight; i++) { if (i > heightBeforeChange) { ExpandHorizontally(i); } Instantiate(blocks[Random.Range(0, blocks.Length)], new Vector3(transform.position.x, transform.position.y + i, transform.position.z), Quaternion.identity); } }