/// <summary> /// 回收 /// </summary> protected override void OnRecycle() { mGuideCommandSender.guideWindow.RemoveGraphicMask(mGraphicMask); mGraphicMask = null; mGuideCommandSender = null; base.OnRecycle(); }
/// <summary> /// 执行处理 /// </summary> /// <param name="_sender">引导命令</param> /// <param name="_sponsor">执行发起者</param> /// <param name="_resolveStatus">解析状态</param> /// <param name="_status">当前状态</param> /// <param name="_parameters">参数</param> protected override void OnExcute(IGuideCommand _sender, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { if (isMatch) { mGraphicMask.SetStyleData(styleConfig); StrayFogGamePools.uiWindowManager.OpenWindow <AbsUIGuideWindowView>(StrayFogGamePools.guideManager.guideWindowId, (wins, pars) => { _sender.guideWindow = wins[0]; _sender.guideWindow.AddGraphicMask(mGraphicMask); }); } base.OnExcute(_sender, _sponsor, _resolveStatus, _status, _parameters); }
/// <summary> /// 执行处理 /// </summary> /// <param name="_sender">引导命令</param> /// <param name="_sponsor">执行发起者</param> /// <param name="_resolveStatus">解析状态</param> /// <param name="_status">当前状态</param> /// <param name="_parameters">参数</param> public void Excute(IGuideCommand _sender, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { int key = (int)(_sender == _sponsor ? _sender.status : resolveStatus); bool result = mGuideResolveMatchCommandMaping.ContainsKey(key) ? mGuideResolveMatchCommandMaping[key].Count > 0 : false; if (result) { foreach (AbsGuideResolveMatchCommand m in mGuideResolveMatchCommandMaping[key]) { m.Excute(_sender, this, _resolveStatus, _status, _parameters); } } OnExcute(_sender, _sponsor, _resolveStatus, _status, _parameters); resolveStatus = OnAfterExcuteResolveStatus(_sender, _sponsor, _resolveStatus, _status, _parameters); }
/// <summary> /// 执行处理 /// </summary> /// <param name="_sender">引导命令</param> /// <param name="_sponsor">执行发起者</param> /// <param name="_resolveStatus">解析状态</param> /// <param name="_status">当前状态</param> /// <param name="_parameters">参数</param> protected override void OnExcute(IGuideCommand _sender, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { base.OnExcute(_sender, _sponsor, _resolveStatus, _status, _parameters); switch (_resolveStatus) { case enGuideStatus.WaitTrigger: status = enGuideStatus.WaitValidate; break; case enGuideStatus.WaitValidate: status = enGuideStatus.Finish; break; } if (status == enGuideStatus.Finish) { OnFinishGuide?.Invoke(this); } }
/// <summary> /// 是否满足条件 /// </summary> /// <param name="_sender">引导命令</param> /// <param name="_sponsor">条件匹配发起者</param> /// <param name="_resolveStatus">解析状态</param> /// <param name="_status">当前状态</param> /// <param name="_parameters">参数</param> /// <returns>true:满足条件,false:不满足条件</returns> public bool isMatchCondition(IGuideCommand _sender, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { int key = (int)_resolveStatus; isMatch = true; List <AbsGuideResolveMatchCommand> matchs = new List <AbsGuideResolveMatchCommand>(); if (mGuideResolveMatchCommandMaping != null && mGuideResolveMatchCommandMaping.ContainsKey(key)) { foreach (AbsGuideResolveMatchCommand m in mGuideResolveMatchCommandMaping[key]) { isMatch &= _sender.LogicalOperator(isMatch, m.isMatchCondition(_sender, this, _resolveStatus, _status, _parameters), m.conditionOperator); matchs.Add(m); } } isMatch &= OnIsMatchCondition(_sender, matchs, _sponsor, _resolveStatus, _status, _parameters); isMatch &= resolveStatus == _resolveStatus; isMatch &= _sender.status == _status; return(isMatch); }
/// <summary> /// 是否满足条件 /// </summary> /// <param name="_conditions">匹配组</param> /// <param name="_sender">引导命令</param> /// <param name="_sponsor">条件匹配发起者</param> /// <param name="_resolveStatus">解析状态</param> /// <param name="_status">当前状态</param> /// <param name="_parameters">参数</param> /// <returns>true:满足条件,false:不满足条件</returns> protected override bool OnIsMatchCondition(IGuideCommand _sender, List <AbsGuideResolveMatchCommand> _conditions, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { //AbsUIGuideGraphic mask = _sender.guideWindow.GetUIGuideGraphic((int)enGuideStatus.WaitTrigger, conditionIndex); bool result = _sender.guideWindow != null && base.OnIsMatchCondition(_sender, _conditions, _sponsor, _resolveStatus, _status, _parameters); if (result) { result = false; if (_parameters != null) { UIGuideValidate validate = null; foreach (object v in _parameters) { if (v is UIGuideValidate) { validate = (UIGuideValidate)v; result = validate.guideId == guideConfig.id && validate.type == (int)enGuideStatus.WaitTrigger && validate.index == conditionIndex; } } } } return(result); }
/// <summary> /// 是否满足条件 /// </summary> /// <param name="_conditions">匹配组</param> /// <param name="_sender">引导命令</param> /// <param name="_sponsor">条件匹配发起者</param> /// <param name="_resolveStatus">解析状态</param> /// <param name="_status">当前状态</param> /// <param name="_parameters">参数</param> /// <returns>true:满足条件,false:不满足条件</returns> protected override bool OnIsMatchCondition(IGuideCommand _sender, List <AbsGuideResolveMatchCommand> _conditions, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { bool result = base.OnIsMatchCondition(_sender, _conditions, _sponsor, _resolveStatus, _status, _parameters); if (_parameters != null && mGraphicMask == null) { foreach (object p in _parameters) { if (p is AbsUIWindowView) { AbsUIWindowView w = (AbsUIWindowView)p; if (w.config.name.Equals(windowName)) { mGuideCommandSender = _sender; mControl = w.FindCtrlByNameIsSelfOrParent <UIBehaviour>(controlName); mGraphicMask = new UIGuideGraphic((int)_sender.status, w.FindCtrlByNameIsSelfOrParent <Graphic>(graphicMask), referObjectIndex); if (mControl != null) { break; } } } } } result &= mControl != null && mGraphicMask != null && mGraphicMask.graphic != null && mGraphicMask.graphic.gameObject.activeInHierarchy == mGraphicMaskActiveSelf; if (result) { UIGuideValidate validate = _sender.CreateValidateMono <UIGuideValidate>(mControl, (int)_sender.status, referObjectIndex); validate.OnEventValidate += Validate_OnEventValidate; } return(result); }
/// <summary> /// 执行后解析状态 /// </summary> /// <returns>解析状态</returns> protected override enGuideStatus OnAfterExcuteResolveStatus(IGuideCommand _sender, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { return(status); }
/// <summary> /// 执行处理 /// </summary> /// <param name="_sender">引导命令</param> /// <param name="_sponsor">执行发起者</param> /// <param name="_resolveStatus">解析状态</param> /// <param name="_status">当前状态</param> /// <param name="_parameters">参数</param> protected virtual void OnExcute(IGuideCommand _sender, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { }
/// <summary> /// 是否满足条件 /// </summary> /// <param name="_sender">引导命令</param> /// <param name="_conditions">条件组</param> /// <param name="_sponsor">条件匹配发起者</param> /// <param name="_resolveStatus">解析状态</param> /// <param name="_status">当前状态</param> /// <param name="_parameters">参数</param> /// <returns>true:满足条件,false:不满足条件</returns> protected virtual bool OnIsMatchCondition(IGuideCommand _sender, List <AbsGuideResolveMatchCommand> _conditions, IGuideMatchConditionCommand _sponsor, enGuideStatus _resolveStatus, enGuideStatus _status, params object[] _parameters) { return(true); }