コード例 #1
0
 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();
 }
コード例 #2
0
 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);
     }
 }