/// <summary> /// 检测触发 /// </summary> /// <param name="_parameters">参数组</param> void OnCheckGuideForWindow(params object[] _parameters) { if (StrayFogGamePools.gameManager.runningSetting.isRunGuide) { if (mCacheWindows != null) { if (mTriggerGuideCommand == null) { foreach (AbsGuideCommand cmd in mWaitGuideCommandMaping.Values) { if (OnIsMatchCondition(cmd, enUserGuideReferObject_ReferType.Refer2D)) { if (cmd.isMatchCondition(mCacheWindows.ToArray())) { mTriggerGuideCommand = cmd; mTriggerGuideCommand.Excute(); break; } } } } else if (OnIsMatchCondition(mTriggerGuideCommand, enUserGuideReferObject_ReferType.Refer2D)) { if (mTriggerGuideCommand.isMatchCondition(mCacheWindows.ToArray())) { mTriggerGuideCommand.Excute(); } } } } }
/// <summary> /// 初始化引导命令 /// </summary> void OnInitGuideResolveCommand() { foreach (XLS_Config_Table_UserGuideConfig cfg in mGuideConfigMaping.Values) { AbsGuideCommand cmd = OnCreateGuideCommand(cfg); if (!mWaitGuideCommandMaping.ContainsKey(cmd.guideConfig.id)) { mWaitGuideCommandMaping.Add(cmd.guideConfig.id, cmd); } } }
/// <summary> /// 是否满足条件 /// </summary> /// <param name="_cmd">命令</param> /// <param name="_referType">对象参考类型</param> /// <returns>true:满足,false:不满足</returns> bool OnIsMatchCondition(AbsGuideCommand _cmd, enUserGuideReferObject_ReferType _referType) { bool result = _cmd != null; if (result) { result &= (_cmd.referType & _referType) == _referType; if (_cmd.guideConfig.levelId > 0) { result &= OnIsLevel(_cmd.guideConfig.levelId); } } return(result); }
/// <summary> /// 创建引导命令 /// </summary> /// <param name="_config">配置</param> /// <returns>命令</returns> AbsGuideCommand OnCreateGuideCommand(XLS_Config_Table_UserGuideConfig _config) { AbsGuideCommand result = null; if (!mCacheGuideTriggerCommandMaping.ContainsKey(_config.guideType)) { mCacheGuideTriggerCommandMaping.Add(_config.guideType, new Queue <AbsGuideCommand>()); } if (mCacheGuideTriggerCommandMaping[_config.guideType].Count > 0) { result = mCacheGuideTriggerCommandMaping[_config.guideType].Dequeue(); } else { result = Cmd_UserGuideConfig_GuideTypeMaping[_config.guideType](); result.OnAfterRecycle += Result_OnAfterRecycle; result.OnFinishGuide += Result_OnFinishGuide; } result.ResolveConfig(_config, (id) => { return(mGuideReferObjectMaping.ContainsKey(id) ? mGuideReferObjectMaping[id] : default); },