Quantcast
Channel: Answers by "Duckocide"
Viewing all articles
Browse latest Browse all 25

Answer by Duckocide

$
0
0
I'd use a coroutine for this. Have a property (boolean) to indicate if times up or not. Every time you want to start the 3 second timer, call the public method "StartTimer" - It will safely stop and start a new timer. In your Update method, monitor the timesUp property ... If it goes true, time is up! public bool timesUp = false; public void StartTimer() { StopCoroutine(StopWatchCR()); StartCoroutine(StopWatchCR()); } private IEnumerator StopWatchCR() { timesUp = false; yield return new WaitForSeconds(3); timesUp = true; }

Viewing all articles
Browse latest Browse all 25

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>