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