Пример #1
0
        public void Release()
        {
            if (State != E_ObjectState.Disabled)
            {
                State = E_ObjectState.Disabled;

                // ...
                if (_registerMode == E_RegisterMode.AlreadyRegister)
                {
                    //unregister
                    //ModuleMgr.Instance.UnRegister(this);
                    _registerMode = E_RegisterMode.AutoRegister;
                }

                OnRelease();
            }
        }
Пример #2
0
        /// <summary>
        /// 把module加到管理类ModuleMgr中
        /// </summary>
        public void Load()
        {
            if (State != E_ObjectState.Initial)
            {
                return;
            }

            State = E_ObjectState.Loading;

            if (_registerMode == E_RegisterMode.AutoRegister)
            {
                //注册到管理类中
                ModuleMgr.Instance.Register(this);
                _registerMode = E_RegisterMode.AlreadyRegister;
            }

            OnLoad();
            State = E_ObjectState.Ready;
        }