Example #1
0
        private static IEnumerator DowndLoadFile(string downLoadUrl, string storageLocaPath, Action <float> progress)
        {
            WWW downloadOperation = new WWW(downLoadUrl);

            CoroutineMgr.StartCoroutinee(DowndLoadFileProg(downloadOperation, progress));
            yield return(downloadOperation);

            if (downloadOperation.isDone && string.IsNullOrEmpty(downloadOperation.error))
            {
                //生成文件
                Byte[] b = downloadOperation.bytes;
                Log.Debug("下载完成:" + storageLocaPath);
                File.WriteAllBytes(storageLocaPath, b);
                progress.Invoke(1);
            }
            else
            {
                progress.Invoke(-1);
            }
        }
Example #2
0
        }  //将json化的字符串可视化显示

        static public void Update()
        {
            float lasttime = TimeHelper.time;

            while (true)
            {
                try
                {
                    TimeHelper.deltaTime = TimeHelper.time - lasttime;
                    lasttime             = TimeHelper.time;

                    Thread.Sleep(1);
                    OneThreadSynchronizationContext.Instance.Update();
                    Entity.Root.Update();
                    CoroutineMgr.UpdateCoroutine();
                }
                catch (Exception e)
                {
                    Log.Error(e);
                }
            }
        }
Example #3
0
 public void Awake()
 {
     Ins = this;
 }
Example #4
0
 public static void DowndLoadProgress(string downLoadUrl, string storageLocaPath, Action <float> progress)
 {
     CoroutineMgr.StartCoroutinee(DowndLoadFile(downLoadUrl, storageLocaPath, progress));
 }
Example #5
0
 //微信分享截屏
 public void WeChatShareScreen()
 {
     CoroutineMgr.StartCoroutinee(CaptureScreen(ScreenFinsh));
 }