Time.timeScaleã«å½±é¿ãããªãWaitForSecondsRealtime
ã³ã«ã¼ãã³ã¨ä¸ç·ã«ãWaitForSecondsããã使ããã¾ãï¼
ä¸å®æéå¾
æ©ããå¾ã«å¦çãåéããã¡ã½ããã§ãï¼
ãããå®ã¯WaitForSecondsã§æ±ãããæéã¯ãTime.timeScaleã«å½±é¿ããã
Time.timeScaleã0ã«ããã¨æ°¸ä¹
ã«åéããã¾ããï¼
Time.timeScaleã®å½±é¿ãç¡è¦ããç¾å®æéåã ãå¾
æ©ãããå ´åã¯ã
WaitForSecondsã®ä»£ããã«WaitForSecondsRealtimeã使ãã¾ãï¼
WaitForSecondsRealtime
using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestScript : MonoBehaviour { // Use this for initialization void Start () { Time.timeScale = 0; StartCoroutine(WaitTime()); StartCoroutine(WaitRealTime()); } IEnumerator WaitTime() { yield return new WaitForSeconds(1f); Debug.Log("Finish WaitTime"); } IEnumerator WaitRealTime() { yield return new WaitForSecondsRealtime(1f); Debug.Log("Finish WaitRealTime"); } }
çµæ
WaitForSecondsã¯Time.timeScaleãæ»ããªãéãæ°¸ä¹
ã«å¾
æ©ãã
WaitForSecondsRealtimeã®ã¿ç¾å®æéã使ããã¦ãããã¨ãåããã¾ãï¼
以ä¸ã§ãï¼