private void Start() { _eventState = DoormatEventState.Default; keysImage.SetActive(false); walletImage.SetActive(false); phoneImage.SetActive(false); k_Key.SetActive(false); w_Key.SetActive(false); p_Key.SetActive(false); }
private void EndDoorEvent() { if (_currentEndTimer != null) { return; } _eventState = DoormatEventState.Default; keysImage.SetActive(false); walletImage.SetActive(false); phoneImage.SetActive(false); k_Key.SetActive(false); w_Key.SetActive(false); p_Key.SetActive(false); _eventStarted = false; doorCam.enabled = false; if (playerExitDoormat != null) { playerExitDoormat(); } }
private void CheckForEventControls() { switch (_eventState) { case DoormatEventState.Default: { if (Input.GetKeyDown(KeyCode.K)) { k_Key.SetActive(false); keysImage.SetActive(true); if (InventoryManager.instance.CheckForObject("Keys")) { w_Key.SetActive(true); _eventState = DoormatEventState.Keys; burstParticles.transform.position = burstPos1.position; burstParticles.Play(); keysCheck(); } else { StartEndTimer(); missingObject(); } break; } break; } case DoormatEventState.Keys: { if (Input.GetKeyDown(KeyCode.W)) { w_Key.SetActive(false); walletImage.SetActive(true); if (InventoryManager.instance.CheckForObject("Wallet")) { p_Key.SetActive(true); _eventState = DoormatEventState.Wallet; burstParticles.transform.position = burstPos2.position; burstParticles.Play(); walletCheck(); } else { StartEndTimer(); missingObject(); } break; } break; } case DoormatEventState.Wallet: { if (Input.GetKeyDown(KeyCode.P)) { p_Key.SetActive(false); phoneImage.SetActive(true); if (InventoryManager.instance.CheckForObject("Phone")) { _eventState = DoormatEventState.Phone; burstParticles.transform.position = burstPos3.position; burstParticles.Play(); phoneCheck(); } else { StartEndTimer(); missingObject(); } break; } break; } case DoormatEventState.Phone: { LevelManager.instance.LoadScene("WinScreen", Color.white); success(); break; } } }