Unity 協程函數(Coroutines) 的使用

協程:協程是一個分部執行,遇到條件(yield return 語句) 時纔會掛起,直到條件知足纔會被喚醒繼續執行後面的代碼。 IEnumerator AliveTimer() { yield return new WaitForSeconds(Random.Range(1,5)); ActivateMonster(); } 協程函數的應用函數: StartCoroutine ("AliveTime
相關文章
相關標籤/搜索