Ejemplo n.º 1
0
        private void _Init()
        {
            Stopwatch watch = Stopwatch.StartNew();

            watch.Start();

            framework = new FrameworkAttRegister();
            if (LoadFromCache)
            {
                if (AsyncInit)
                {
                    framework.LoadFromCache(cached);
                }
                else
                {
                    framework.LoadFromCache(MainLoopAsset);
                }
            }
            else
            {
                framework.Initialite();
            }

            flag++;

            watch.Stop();

            LogMgr.LogFormat("::::FrameWork Cost Time :{0}", watch.Elapsed.TotalSeconds.ToString());
        }
Ejemplo n.º 2
0
        public void SaveTypeCache()
        {
#if UNITY_EDITOR
            framework = new FrameworkAttRegister();
            framework.SaveToCache(MainLoopAsset);
#endif
        }
Ejemplo n.º 3
0
        public void SaveTypeCache()
        {
#if UNITY_EDITOR
            LogMgr.Log("开始打包类型缓存");
            framework = new FrameworkAttRegister();
            framework.SaveToCache(MainLoopAsset);
            LogMgr.Log("结束打包类型缓存");
#endif
        }
Ejemplo n.º 4
0
        public void Destroy()
        {
            List <AbstractLayout> lays = this.layouts.ReadOnlyValues;

            for (int i = 0; i < lays.Count; ++i)
            {
                AbstractLayout lay = lays[i];
                lay.Release();
                lay.Clear(true);
            }

            this.layouts.Clear();

            FrameworkAttRegister.DestroyStaticAttEvent(MainLoopEvent.OnLevelLeaved, typeof(GameUIControl), "ListenerScene");
            FrameworkAttRegister.DestroyStaticAttEvent(MainLoopEvent.OnLevelWasLoaded, typeof(GameUIControl), "ListenSceneEnter");
        }
Ejemplo n.º 5
0
        public void Destroy()
        {
            if (SceneOpDic != null)
            {
                var en = SceneOpDic.GetEnumerator();
                while (en.MoveNext())
                {
                    var valueEn = en.Current.Value.GetEnumerator();
                    while (valueEn.MoveNext())
                    {
                        List <FieldInfo> fs = valueEn.Current.Value;
                        for (int i = 0; i < fs.Count; ++i)
                        {
                            fs[i].SetValue(null, null);
                        }
                    }
                }
                SceneOpDic.Clear();
                SceneOpDic = null;

                FrameworkAttRegister.DestroyStaticAttEvent(MainLoopEvent.OnLevelWasLoaded, typeof(GameSceneCtr), "EnterScene");
                FrameworkAttRegister.DestroyStaticAttEvent(MainLoopEvent.OnLevelLeaved, typeof(GameSceneCtr), "LeavedScene");
            }
        }