private void Update() { if (Input.GetKeyDown(KeyCode.Tab)) { UIScenesManager.ShowUI <GamePlayUI>(); } }
public void TakeDamage(int _AttackDamage) { _Health -= _AttackDamage; _AudioSource.clip = _clipPlayerDamaged; _AudioSource.Play(); _ChrAnim.SetTrigger("isDamaged"); if (_Health <= 0) { if (gameObject.tag == "Player") { _AudioSource.clip = _clipPlayerDie; _AudioSource.Play(); _ChrAnim.SetTrigger("isDead"); UIScenesManager.ShowUI <DeathUI>(); } else { _ChrAnim.SetTrigger("isDead"); Instantiate(_deathSplash, transform.position, transform.rotation); DetachChild(); gameObject.SetActive(false); currentTile.SetHasNoEnemy(); } } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player" && !_IsVisited) { _IsVisited = true; UIScenesManager.ShowUI <MiniGame>(); _Light.enabled = false; }// load the minigame scene when player enters the trigger }
private void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { UIScenesManager.ShowUI <Pause>(); } else if (Input.GetKeyDown(KeyCode.Tab)) { UIScenesManager.ShowUI <ControlCanvas>(); } }
// check if the answer matches the right order private void CheckForResult() { int tmp = 0; foreach (int i in _ButtonClicked) { // Debug.Log("Color at " + tmp + " is: " + _Buttons[i].colors.normalColor); // Debug.Log("Color at " + tmp + " in Order is: " + _Order[tmp]); _Result = (_Result && _Buttons[i].colors.normalColor == _Order[tmp]); tmp++; } // Debug.Log("Checking the answer!" + _Result.ToString()); if (_Result) { UIScenesManager.ShowUI <GamePlayUI>(); HackingCounter.OnHackSuccess(); // Debug.Log("Exit!"); }// if the answer is correct then unload the scene Reset(); }
public void OnBackToGameButtonClicked() { UIScenesManager.ShowUI <GamePlayUI>(); }