public IEnumerator SetGameOver() { //byte Resistance_byte = Convert.ToByte(GlobalValue.Resistance * 10); //byte[] over = { 0x55, 0xA4, 0x01, 0x00, 0x00, 0x90 }; //SendBytes(over);//傳驅動關閉 SetRpm = false; _IsportTimeController.CumulativeSwitch = false; ParentObjList[0].GetComponent <SplineFollower>().followSpeed = 0; PlayerObjList[0].GetComponent <SplineFollower>().followSpeed = 0; ChaserObjList[0].GetComponent <SplineFollower>().followSpeed = 0; //ParentObjList[0].GetComponent<SplineFollower>().enabled=false; //PlayerObjList[0].GetComponent<SplineFollower>().enabled=false; //ChaserObjList[0].GetComponent<SplineFollower>().enabled=false; ParentAnimator.SetBool("Run", false); RunnerAnimator.SetBool("Run", false); ChaserAnimator.SetBool("Run", false); //ParentAnimator.SetBool("over", true); //RunnerAnimator.SetBool("over", true); //ChaserAnimator.SetBool("over", true); if (_IsportTimeController.AllTime > 0)//被點取離開時的事件處理 { //FadePanelObj.GetComponent<Animation>().clip = ExitPlanelFadeOut; FadePanelObj.SetActive(true); yield return(new WaitForSeconds(2.0f)); SceneManager.LoadScene("GameTitle"); } else//時間結束自然自然離開時的事件處理 { ExitButtonObj.SetActive(false); //ChickenSFX.PlayOneShot(_AudioClipManagers.SFX[5]); yield return(new WaitForSeconds(2.0f)); } }
IEnumerator Start3sec() { CenterTextObj.GetComponent <Text>().text = "3"; yield return(new WaitForSeconds(1)); CenterTextObj.GetComponent <Text>().text = "2"; yield return(new WaitForSeconds(1)); CenterTextObj.GetComponent <Text>().text = "1"; yield return(new WaitForSeconds(1)); CenterTextObj.GetComponent <Text>().text = "體能運動開始!"; yield return(new WaitForSeconds(0.5f)); CenterTextObj.GetComponent <Text>().text = ""; ParentObjList[0].GetComponent <SplineFollower>().followSpeed = 5; //PlayerObjList[0].GetComponent<SplineFollower>().followSpeed = 5; ChaserObjList[0].GetComponent <SplineFollower>().followSpeed = 5; ParentAnimator.SetBool("Run", true); RunnerAnimator.SetBool("Run", true); ChaserAnimator.SetBool("Run", true); _IsportTimeController.CumulativeSwitch = true; StartCoroutine(_IsportTimeController.GameStartTimeCumulative());//控制時間開始計時 SetRpm = true; ExitButtonObj.SetActive(true); //FadePanelObj.SetActive(false); }