public void SpawnKeyByKillCount(Vector3 position) { //Key=Instantiate(_keyPrefab, position, Quaternion.identity); _key = Instantiate(_keyPrefab, position, Quaternion.Euler(new Vector3(0, 0, -90))); _key.name = _arenaManager.GetKeyName(); //GameObject.Destroy(this.gameObject); //this.gameObject.SetActive(false); GetComponent <KeySpawner>().enabled = false; }
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(); } } }