Example #1
0
        /// <summary>
        /// 进入视图
        /// </summary>
        /// <param name="viewId">视图id</param>
        /// <param name="options">选项</param>
        /// <param name="callback">进入完成回调</param>
        public void Enter(int viewId, EnterOptions options = EnterOptions.None, Action callback = null)
        {
            ProcessEnterOptions(IntGroup.Get(viewId), options);

            ViewState state;

            _viewDic.TryGetValue(viewId, out state);

            if (!state.active)
            {
                state.active     = true;
                _viewDic[viewId] = state;

                OnViewEnterStartEvent?.Invoke(viewId);

                _uiModule?.Enter(viewId, () =>
                {
                    callback?.Invoke();
                    _uiModule?.Focus(viewId);
                    OnViewEnterCompletedEvent?.Invoke(viewId);
                });
            }
            else
            {
                _uiModule?.Focus(viewId);
                callback?.Invoke();
            }
        }
Example #2
0
 public void Enter(int viewId, bool anim = false, Action callback = null)
 {
     _uiModule?.Enter(viewId, anim, callback);
 }
Example #3
0
 private static void EnterModule(IUIModule module, object param = null)
 {
     _currModule?.Leave();
     module.Enter(param);
     _currModule = module;
 }