Esempio n. 1
0
 public static void Dispose()
 {
     ThreadMission.DisposeAll();
     RecordManager.ReleaseAll();
     ElementAsset.bundles.Clear();
     AssetBundle.UnloadAllAssetBundles(true);
 }
        public static void InvokeToMain(Action <object> action, object dat, Action <object> wait = null)
        {
            var id = Thread.CurrentThread.ManagedThreadId;

            if (id == MainID)
            {
                for (int i = 0; i < threads.Count; i++)
                {
                    if (threads[i].Tag == null)
                    {
                        threads[i].AddMainMission(action, dat, wait);
                        return;
                    }
                }
                var mis = new ThreadMission(null);
                mis.AddMainMission(action, dat, wait);
                threads.Add(mis);
            }
            else
            {
                for (int i = 0; i < threads.Count; i++)
                {
                    if (threads[i].Id == id)
                    {
                        threads[i].AddMainMission(action, dat, wait);
                        return;
                    }
                }
            }
        }
Esempio n. 3
0
 public static void Initial(Transform uiRoot)
 {
     ThreadMission.SetMianId();
     Scale.Initial();
     InitialInput();
     UIRoot = uiRoot;
     CreateUI();
 }
Esempio n. 4
0
        /// <summary>
        /// 初始化UI布局
        /// </summary>
        /// <param name="uiRoot"></param>
        public static void Initial(Transform uiRoot)
        {
            ThreadMission.SetMianId();
#if UNITY_STANDALONE_WIN || UNITY_EDITOR
            IME.Initial();
#endif
            UIRoot = uiRoot;
            CreateUI();
        }
Esempio n. 5
0
        /// <summary>
        /// 释放资源:包含ThreadMission,RecordManager,ElementAsset,AssetBundle
        /// </summary>
        public static void Dispose()
        {
            ThreadMission.DisposeAll();
            RecordManager.ReleaseAll();
            ElementAsset.bundles.Clear();
            AssetBundle.UnloadAllAssetBundles(true);
#if UNITY_STANDALONE_WIN || UNITY_EDITOR
            IME.Dispose();
#endif
        }
Esempio n. 6
0
 public static void Update()
 {
     AnimationManage.Manage.Update();
     UserAction.DispatchEvent();
     Keyboard.DispatchEvent();
     ThreadMission.ExtcuteMain();
     Resize();
     UIPage.Refresh(UserAction.TimeSlice);
     AllTime += Time.deltaTime;
     //DownloadManager.UpdateMission();
 }
 public static void Initial(Transform uiRoot)
 {
     ThreadMission.SetMianId();
     Scale.Initial();
     InitialInput();
     RegUI();
     UIRoot = uiRoot as RectTransform;
     if (UIRoot == null)
     {
         UIRoot = new GameObject("UI", typeof(Canvas)).transform as RectTransform;
         UIRoot.GetComponent <Canvas>().renderMode = RenderMode.ScreenSpaceOverlay;
     }
     CreateUI();
     mission = ThreadMission.CreateMission("UI");
 }
Esempio n. 8
0
        public static void Update()
        {
            Scale.MainUpdate();

            UserAction.Update();
            RenderForm.LoadAction();
            InputCaret.UpdateCaret();
            Keyboard.DispatchEvent();
            RenderForm.ApplyAll();
            ThreadMission.ExtcuteMain();
            ModelManagerUI.RecycleGameObject();
            AnimationManage.Manage.Update();
            AllTime += Time.deltaTime;
            mission.AddSubMission(SubThread, null);
        }
        public static void AddMission(Action <object> action, object dat, string tag = null, Action <object> wait = null)
        {
            if (threads == null)
            {
                return;
            }
            for (int i = 0; i < threads.Count; i++)
            {
                if (threads[i].Tag == tag)
                {
                    threads[i].AddSubMission(action, dat, wait);
                    return;
                }
            }
            var mis = new ThreadMission(null);

            mis.AddSubMission(action, dat, wait);
            threads.Add(mis);
        }
 static void ExtcuteMain(ThreadMission mission)
 {
     for (int j = 0; j < 2048; j++)
     {
         var m = mission.MainMission.Dequeue();
         if (m == null)
         {
             mission.mainFree = true;
             break;
         }
         else
         {
             mission.mainFree = false;
             m.action(m.data);
             if (m.waitAction != null)
             {
                 mission.AddSubMission(m.waitAction, m.data);
             }
         }
     }
 }
Esempio n. 11
0
 public static void Dispose()
 {
     EventCallBack.ClearEvent();
     ThreadMission.DisposeAll();
     RecordManager.ReleaseAll();
 }