Exemple #1
0
 private void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
     }
 }
Exemple #2
0
 //Start()より早く一度だけ実行される関数
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else if (_instance != null)
     {
         Destroy(this.gameObject);
     }
 }
Exemple #3
0
    public void Shoot()
    {
        _fireArrow.SetActive(false);
        ArrowSpawner.GetInstance().Shoot(_shootPower.Evaluate(_charged));
        _shootSound.Play();

        if (_chargingSound.isPlaying)
        {
            _chargingSound.Stop();
        }

        _charged = 0f;
    }