Example #1
0
        public void Update(float dt)
        {
            DaemonManager.Instance().Run();

            Dictionary <int, GameObjRef> .Enumerator it = m_dicObjRef.GetEnumerator();
            m_lstObjsRefKey.Clear();
            while (it.MoveNext())
            {
                if (it.Current.Value.go == null)
                {
                    m_lstObjsRefKey.Add(it.Current.Key);
                    it.Current.Value.goObj.Release();
                }
            }
            for (int i = 0; i < m_lstObjsRefKey.Count; i++)
            {
                m_dicObjRef[m_lstObjsRefKey[i]] = null;
                m_dicObjRef.Remove(m_lstObjsRefKey[i]);
            }



            RenderObjManager.Instance().Update(dt);
            ResourceManager.Instance().Update(dt);
        }
Example #2
0
        public static DaemonManager Instance()
        {
            if (_inst == null)
            {
                _inst = new DaemonManager();
            }

            return(_inst);
        }
Example #3
0
        /// //////////////////////////////////////////////////////////////
        public static void ThreadProc(object obj)
        {
            DaemonManager daemonTask = (DaemonManager)obj;

            if (daemonTask != null)
            {
                daemonTask.DaemonProc();
            }
        }
Example #4
0
        public static AssetManager Instance()
        {
            if (null == s_Inst)
            {
                s_Inst = new AssetManager();
                DaemonManager.Instance().Init();
            }

            return(s_Inst);
        }
Example #5
0
 /// <summary>
 /// 加载资源
 /// </summary>
 /// <returns></returns>
 virtual public bool LoadRes()
 {
     // 投递任务到后台管理器
     DaemonManager.Instance().AddTask(this);
     return(false);
 }