static void __Setup() { m_appBhv = ComponentUtil.EnsureComponent <CCAppBhv>(m_gRoot); if (!m_trash) { m_trash = GameObjUtil.CreateGameobj("Trash"); GameObjUtil.DontDestroyOnLoad(m_trash); m_trash.transform.position = new Vector3(-1000, -1000, -1000); m_trash.isStatic = true; //设置为静态对象 } m_resMgr = m_resMgr ?? new ResMgr(); m_resMgr.Setup(); m_soundMgr = m_soundMgr ?? new SoundMgr(m_gRoot); m_soundMgr.Setup(); m_keyboard.Setup(); m_classPools = ClassPools.me; // TimerMgr.inst.Setup(); // ActionMgr.inst.Setup(); // UserPrefs.Setup(); if (CCDefine.DEBUG) { //显示帧频 ComponentUtil.EnsureComponent <FpsTicker>(m_gRoot); } LogFile.Run(); }
static void __Clear() { m_keyboard.Clear(); m_subject.DetachAll(); m_autoRelease.Excute(); m_resMgr.Clear(); m_soundMgr.Clear(); //对象池清除 m_classPools.Clear(); m_classPools = null; //单例清除 TimerMgr.inst.Clear(); ActionMgr.inst.Clear(); UserPrefs.Clear(); Refer.ClearNotify(); GameObject.Destroy(m_appBhv); m_appBhv = null; m_gRoot = null; m_onLateUpdate = null; m_onUpdate = null; m_onGui = null; if (m_trash) { m_trash = GameObjUtil.Delete(m_trash); } }