Esempio n. 1
0
 void OnTriggerEnter2D(Collider2D otherCollider)
 {
     if (otherCollider.CompareTag("SpawnPoint"))
     {
         try
         {
             if (otherCollider.GetComponent <RoomSpawner>().spawned == false && spawned == false)
             {
                 go = Instantiate(templates.getClosedRoom(), transform.position, Quaternion.identity);
                 go.transform.parent = GameObject.Find("Grid").transform;
                 Destroy(gameObject);
             }
             spawned = true;
         }
         catch (System.Exception e)
         {
         }
     }
 }