From 4911084e3474aa223c234c84b0063df911e4b7ef Mon Sep 17 00:00:00 2001 From: IwamotoKakeru Date: Fri, 3 May 2024 21:22:24 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=97=A9=E9=80=81=E3=82=8A?= =?UTF-8?q?=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E3=82=BD=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E3=83=AA=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit デフォルト値がある関数には値を渡さないように BgmManagerが存在しなかった際のメッセージを修正 --- Assets/Scripts/BgmManager.cs | 4 ++-- Assets/Scripts/TimeCtrl.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/BgmManager.cs b/Assets/Scripts/BgmManager.cs index 104b5bb..e562807 100644 --- a/Assets/Scripts/BgmManager.cs +++ b/Assets/Scripts/BgmManager.cs @@ -65,7 +65,7 @@ void PlayBgm(int buildIndex) case SceneIndex.Ending: audioSource.clip = ending; CountinuPlay(); - SetPitch(1.0f); + SetPitch(); break; default: @@ -79,7 +79,7 @@ void PlayBgm(int buildIndex) /// /// BGMの速さを変更する /// - /// 速度 + /// 速度 無引数なら1.0 public void SetPitch(float pitch = 1.0f) { audioSource.pitch = pitch; diff --git a/Assets/Scripts/TimeCtrl.cs b/Assets/Scripts/TimeCtrl.cs index 9002331..c1ffd20 100644 --- a/Assets/Scripts/TimeCtrl.cs +++ b/Assets/Scripts/TimeCtrl.cs @@ -22,7 +22,7 @@ void Start() { bgmManager = null; Debug.Log(e); - Debug.Log("BgmManagerが見つかりませんでした"); + Debug.Log("BgmManagerが見つからなかったためbgmManagerをnullとして扱います"); } } void Update() @@ -49,7 +49,7 @@ public void FastFoward(bool toggleFlag, float fastTimeScale = defaultFastTimeSca else { Time.timeScale = defaultTimeScale; - bgmManager?.SetPitch(defaultTimeScale); + bgmManager?.SetPitch(); } } @@ -63,7 +63,7 @@ public void StopTime(bool stopFlag) if (stopFlag) { Time.timeScale = 0; - bgmManager?.SetPitch(defaultTimeScale); + bgmManager?.SetPitch(); } else {