private void Start() { _animator = GetComponent <Animator>(); _rigidbody = GetComponent <Rigidbody>(); _playerAudioSource = GetComponent <AudioSource>(); _playerShoot = _playerAudioSource.clip; BlueKeyIsGrab = false; RedKeyIsGrab = false; GoldKeyIsGrab = false; _isMove = false; ammo = 20; bombAmmo = 5; _playerUI.AmmoChnge(); _playerUI.BombChnge(); _playerUI.HealhtChange(); }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Player")) { _playerController.bombAmmo++; _playerUI = GameObject.FindGameObjectWithTag("PlayerUI").GetComponent <UIScript>(); _playerUI.BombChnge(); _soundManagerObject.transform.position = transform.position; _soundManager.PlaySound(_soundManager.takeBombAudio); Destroy(gameObject); } }