public void TryUnlock() { if (!Unlocked) { if (GameManager.Instance.ChangeScore(-1 * _unlockCost)) { Unlocked = true; AttachedRoom currRoom = GetCurrentAttachedRoom(); if (currRoom == AttachedRoom.Room1) { _room2.Open = true; } else if (currRoom == AttachedRoom.Room2) { _room1.Open = true; } } else { Debug.LogWarning("Not enough score to unlock."); } } else { Debug.LogWarning("Already unlocked."); } }
public void EnterOtherRoom() { AttachedRoom currRoom = GetCurrentAttachedRoom(); if (currRoom == AttachedRoom.Room1) { _room2.Enter(); } else if (currRoom == AttachedRoom.Room2) { _room1.Enter(); } else { Debug.LogError("The door can't be used from this room."); } }