C#延時程式碼
阿新 • • 發佈:2019-01-29
StartCoroutine(StartBGM());
IEnumerator StartBGM(){yield return new WaitForSeconds(0.5f);while(PatternSystem.instance.loadingComplete == false){yield return 0;}Debug.Log("play");bgmSound.Play();}
---------------------------------------------------------分割線----------------------------------------------------------------------
void Update () {//if press any key jump to gameplay sceneif(Input.anyKeyDown){if(!oneshotSfx){AudioSource.PlayClipAtPoint(sfxButton,Vector3.zero);Invoke("LoadScene",0.5f);oneshotSfx = true;}}}void LoadScene(){//load gameplay sceneApplication.LoadLevel("GamePlay");}
IEnumerator StartBGM(){yield return new WaitForSeconds(0.5f);while(PatternSystem.instance.loadingComplete == false){yield return 0;}Debug.Log("play");bgmSound.Play();}
---------------------------------------------------------分割線----------------------------------------------------------------------