public void Ready(Vector3 where) { transform.position = where; expend.SetActive(false); bullet.SetActive(true); another.Close(); }
void Update() { _health = Mathf.Clamp(_health, 0, 1000); if (Input.GetButtonDown("Fire2")) { _audioController.Play(); Instantiate(bullet, muzzle.transform.position, muzzle.transform.rotation); } if (_health <= 0) { AudioSource cameraSource = GameObject.Find("Main Camera").GetComponent <AudioSource>(); cameraSource.Stop(); cameraSource.clip = _gameOverClip; cameraSource.Play(); Destroy(gameObject); } if (Input.GetKeyDown("e")) { if (_doorInstance != null) { if (_doorInstance._isSolved) { if (_doorInstance.IsOpen) { _doorInstance.Close(); } else { _doorInstance.Open(); } } else { _pauseController.ShowPasscodeScreen(_doorInstance); } } } }
void OnTriggerExit(Collider other) { DoorControl dc = door.GetComponent <DoorControl>(); dc.Close(); }