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.ammo += 10; _playerUI = GameObject.FindGameObjectWithTag("PlayerUI").GetComponent <UIScript>(); _playerUI.AmmoChnge(); _soundManagerObject.transform.position = transform.position; _soundManager.PlaySound(_soundManager.takeAmmoAudio); Destroy(gameObject); } }