Skip to content

Commit

Permalink
Merge pull request #34 from IwamotoKakeru/refactor/fast-foward
Browse files Browse the repository at this point in the history
refactor: 早送りに関するソースコードのリファクタリング
  • Loading branch information
IwamotoKakeru authored May 3, 2024
2 parents 499a400 + 4911084 commit f3c76d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Assets/Scripts/BgmManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void PlayBgm(int buildIndex)
case SceneIndex.Ending:
audioSource.clip = ending;
CountinuPlay();
SetPitch(1.0f);
SetPitch();
break;

default:
Expand All @@ -79,7 +79,7 @@ void PlayBgm(int buildIndex)
/// <summary>
/// BGMの速さを変更する
/// </summary>
/// <param name="pitch">速度</param>
/// <param name="pitch">速度 無引数なら1.0</param>
public void SetPitch(float pitch = 1.0f)
{
audioSource.pitch = pitch;
Expand Down
6 changes: 3 additions & 3 deletions Assets/Scripts/TimeCtrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void Start()
{
bgmManager = null;
Debug.Log(e);
Debug.Log("BgmManagerが見つかりませんでした");
Debug.Log("BgmManagerが見つからなかったためbgmManagerをnullとして扱います");
}
}
void Update()
Expand All @@ -49,7 +49,7 @@ public void FastFoward(bool toggleFlag, float fastTimeScale = defaultFastTimeSca
else
{
Time.timeScale = defaultTimeScale;
bgmManager?.SetPitch(defaultTimeScale);
bgmManager?.SetPitch();
}
}

Expand All @@ -63,7 +63,7 @@ public void StopTime(bool stopFlag)
if (stopFlag)
{
Time.timeScale = 0;
bgmManager?.SetPitch(defaultTimeScale);
bgmManager?.SetPitch();
}
else
{
Expand Down

0 comments on commit f3c76d9

Please sign in to comment.