public void ReceiveMessage(CSMessage Msg) { lock (ReceiveMessageQueue) { ReceiveMessageQueue.Enqueue(Msg); if (!IsDealMesageing) { MyCentorl.VP(0, () => { IsDealMesageing = true; MyCentorl.StartCoroutine(DealMesageCoroutine()); }); } } }
private IEnumerator LoadSceneControl(ISceneLoadCompBase SceneLoadComp, float Start, float Target) { CurrSceneLoadComp = SceneLoadComp; int currProcess = 0; int toProcess = 0; if (CurrSceneLoadComp != null) { MyCentorl.StartCoroutine(CurrSceneLoadComp.LoadScene()); while (LoadSceneProgress < Target) { toProcess = (int)(CurrSceneLoadComp.GetProcess() * 100); while (currProcess < toProcess) { ++currProcess; LoadSceneProgress = Mathf.Lerp(Start, Target, currProcess / 100.0f); Cheduler.UpdataProgress(LoadSceneProgress); yield return(new WaitForEndOfFrame()); } yield return(new WaitForEndOfFrame()); } } else { toProcess = 100; while (LoadSceneProgress < Target) { while (currProcess < toProcess) { ++currProcess; LoadSceneProgress = Mathf.Lerp(Start, Target, currProcess / 100.0f); Cheduler.UpdataProgress(LoadSceneProgress); yield return(new WaitForEndOfFrame()); } yield return(new WaitForEndOfFrame()); } } }
public void ChangeScene(ISceneLoadCompBase SceneLoadComp) { LoadSceneProgress = 0; MyCentorl.StartCoroutine(ChangeSceneCoroutine(SceneLoadComp)); }