Exemple #1
0
        public void Remove <T>() where T : ICompose
        {
            System.Type type   = typeof(T);
            ICompose    module = null;

            if (mModuleDys.TryGetValue(type, out module))
            {
                mModuleLts.Remove(module);
                mModuleDys.Remove(type);
                module.OnRemove();
            }
        }
Exemple #2
0
    public void Remove <T>() where T : ICompose
    {
        if (m_Dispose)
        {
            return;
        }
        ICompose compose = Find <T>();

        if (compose != null)
        {
            m_Composes.Remove(compose);
            compose.OnRemove();
        }
    }
Exemple #3
0
        /*  这里使用TryGetValue而不用ContainsKey,更方便之后对compose进行OnRemove
         *  Remove的同时组件的Remove也要被触发
         */
        public void Remove <T>() where T : ICompose
        {
            System.Type type = typeof(T);
            if (debug)
            {
                Debug.Log("game manager remove " + type.Name);
            }
            ICompose compose = null;

            if (composeDict.TryGetValue(type, out compose))
            {
                composeDict.Remove(type);
                composeList.Remove(compose);
                compose.OnRemove();
            }
        }