Esempio n. 1
0
 public void ReceiveMessage(CSMessage Msg)
 {
     lock (ReceiveMessageQueue)
     {
         ReceiveMessageQueue.Enqueue(Msg);
         if (!IsDealMesageing)
         {
             MyCentorl.VP(0, () =>
             {
                 IsDealMesageing = true;
                 MyCentorl.StartCoroutine(DealMesageCoroutine());
             });
         }
     }
 }
Esempio n. 2
0
        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());
                }
            }
        }
Esempio n. 3
0
 public void ChangeScene(ISceneLoadCompBase SceneLoadComp)
 {
     LoadSceneProgress = 0;
     MyCentorl.StartCoroutine(ChangeSceneCoroutine(SceneLoadComp));
 }