Exemple #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.name == _arenaManager.GetKeyName())
     {
         GameObject.Destroy(other.gameObject);
         _keySpawner.Portal.GetComponent <BoxCollider>().enabled = true;
         StopLevel();
     }
     else
     {
         if (other.name == _arenaManager.GetPortalName())
         {
             GameObject.Destroy(other.gameObject);
             NextLevel();
         }
     }
 }
 public void Init(ArenaManager arenaManager)
 {
     _arenaManager = arenaManager;
     _portal       = Instantiate(_portalPrefab, new Vector3(0, 1, 0), Quaternion.identity);
     _portal.name  = _arenaManager.GetPortalName();
 }