This commit is contained in:
Ino 2025-05-23 15:46:39 +09:00
parent ab48357f89
commit 921479fee6
1 changed files with 3 additions and 2 deletions

View File

@ -10,10 +10,11 @@ public class TimeMgr : MonoBehaviourSingletonTemplate<TimeMgr>
public void Set_TimeScale(float delaytime, float _timescale) public void Set_TimeScale(float delaytime, float _timescale)
{ {
StartCoroutine(Run_Coroutine(delaytime, _timescale)); StopCoroutine(nameof(Run_TimeScale));
StartCoroutine(Run_TimeScale(delaytime, _timescale));
} }
IEnumerator Run_Coroutine(float delaytime, float _timescale) IEnumerator Run_TimeScale(float delaytime, float _timescale)
{ {
Time.timeScale = _timescale; Time.timeScale = _timescale;
yield return new WaitForSeconds(delaytime); yield return new WaitForSeconds(delaytime);