public override void Initialize(CharacterClass characterClass) { characterClass.DamagedEnemy.AddListener((health) => { Exit exit = health.GetComponent <Exit>(); if (exit != null) { exit.EnableExit(true); } }); }
private void ResolveExitCollision(Exit curExit, RoomEntrances otherEntrances) { if (otherEntrances.NExits == 1) { // Debug.Log("Tried connecting room to exit. just return."); curExit.gameObject.SetActive(false); return; } // TODO: #11 Enable door if next to other room (Maybe some can be secret?) Teleporter otherTeleporter = otherEntrances.GetTeleporterFromDirection(curExit.RequiredEntranceDirection); otherTeleporter.GetComponent <Exit>().EnableExit(); curExit.EnableExit(); SetupTeleporters(curExit.Teleporter, otherTeleporter); remainingExitsToCreate++; }