protected override void onEnter(TBTWorkingData wData) { GuideWorkingData gData = wData as GuideWorkingData; bool IsAutoGuideUIPlaying = gData.GuideDynamicBB.GetValue <bool>(EGuideBBKey.IsAutoGuideMessagePlaying, false); int AutoGuideMessageID = m_nAutoGuideMessageID == -1 ? gData.GuideDynamicBB.GetValue <int>(EGuideBBKey.AutoGuideMessageID, -1) : m_nAutoGuideMessageID; //if ((!IsAutoGuideUIPlaying && AutoGuideMessageID != -1 && AutoGuideMessageID != m_nCurrentID)) if ((AutoGuideMessageID != -1))//&& AutoGuideMessageID != m_nCurrentID)) { gData.GuideDynamicBB.SetValue(EGuideBBKey.IsAutoGuideMessagePlaying, true); m_nCurrentID = AutoGuideMessageID; SSchemeGuideNodeData guideNodeData = GuideManager.Instance.getNodeConfigData((EGuideNodeID)m_nCurrentID); int nDelayRemoveTime = guideNodeData.GuideIntParams[(int)EGuideNodeConfigParamID.GuideParamID_0]; if (guideNodeData.GuideIntParams.Count > (int)EGuideNodeConfigParamID.GuideParamID_1) { int nSoundID = guideNodeData.GuideIntParams[(int)EGuideNodeConfigParamID.GuideParamID_1]; SoundManager.CreateUISound(nSoundID); } string strMessage = guideNodeData.GuideStringParams[(int)EGuideNodeConfigParamID.GuideParamID_0]; UISystem.Instance.SendTargetWndMessage(WndID.WND_ID_GAMEGUIDE, WndMsgID.WND_MSG_GAMEGUIDE_ADDAUTOMESSAGE, new UGuideMsgData(strMessage, (EGuideNodeID)m_nCurrentID, nDelayRemoveTime)); gData.GuideDynamicBB.SetValue(EGuideBBKey.AutoGuideMessageID, -1); } base.onEnter(wData); }
protected override bool CustomPrecondition(TBTWorkingData wData) { bool result = false; SSchemeGuideNodeData cData = GuideManager.Instance.getNodeConfigData(m_nNodeID); result = cData != null ? !cData.bGuideFinished : false; if (cData != null) { TLogger.PROFILE("判断引导::" + m_nNodeID + " 是否已结束::" + cData.bGuideFinished); } return(result); }
protected override void onExit(TBTWorkingData wData, int runningStatus) { GuideWorkingData gData = wData as GuideWorkingData; if (m_bFinishRemoveUIMessage) { USpeedUI.UGuideMsgRemoveData msg = new USpeedUI.UGuideMsgRemoveData(); USpeedUI.UISystem.Instance.SendWndMessage(USpeedUI.WndMsgID.WND_MSG_GAMEGUIDE_REMOVENODEMESSAGE, msg); } SSchemeGuideNodeData cData = GuideManager.Instance.getNodeConfigData(gData.GuideCurrentNode); cData.bGuideFinished = true; base.onExit(wData, runningStatus); }
public void CreateNewDynamicGuideRoot(TBTWorkingData wData) { if (m_GuideDynamicRoot == null) { GuideWorkingData data = wData as GuideWorkingData; if (data != null && data.GuideDynamicBB != null) { int GuideStateID = data.GuideStateBB.GetValue <int>(EGuideStateBBKey.GuideStateID, -1); SSchemeGuideStateData stateData = GetGuideStateData(GuideStateID); if (stateData != null) { m_GuideDynamicRoot = CreateDynamicRoot(stateData.GuideRootType); for (int j = 0; j < stateData.GuideNodeIDList.Count; ++j) { EGuideNodeID guideNodeID = (EGuideNodeID)stateData.GuideNodeIDList[j]; SSchemeGuideNodeData guideNodeData = null; if (dicGuideConfigTable.TryGetValue(guideNodeID, out guideNodeData)) { //先根据引导节点需要挂接的父节点类型处理 EGuideActionLayerType layerType = (EGuideActionLayerType)guideNodeData.nGuideActionLayerType; TBTAction layerTypeAction = null; if (!m_GuideDynamicRoot.TryGetLayerTypeAction(layerType, out layerTypeAction)) { layerTypeAction = CreateLayerTypeAction(layerType); m_GuideDynamicRoot.AddChild(layerTypeAction); } layerTypeAction.AddChild(getNodeDataInstance(guideNodeID)); } else { Trace.LogWarning("没有引导ID为:" + guideNodeID + " 的引导数据,配错了?"); } } } } } }
protected void _LoadGuideNodeConfig(string _strPath) { dicGuideConfigTable = new Dictionary <EGuideNodeID, SSchemeGuideNodeData>(); ScpReader reader = new ScpReader(_strPath, true); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeGuideNodeData sConfig = new SSchemeGuideNodeData(); sConfig.nGuideID = reader.GetInt(i, (int)EGuideNodeConfig.GuideID, -1); sConfig.GuideStringParams = ScpReader.ToStringList(reader.GetString(i, (int)EGuideNodeConfig.GuideActionStringParams, ""), new char[] { ';' }); sConfig.GuideIntParams = ScpReader.ConvertStringToIntArray(reader.GetString(i, (int)EGuideNodeConfig.GuideActionIntParams, ""), new char[] { ';' }); //sConfig.GuidePreconditionIntParams = ScpReader.ConvertStringToIntArray(reader.GetString(i, (int)EGuideNodeConfig.GuidePreconditionIntParams, ""), new char[] { ';' }); sConfig.nGuideActionLayerType = reader.GetInt(i, (int)EGuideNodeConfig.GuideActionLayerType, 0); dicGuideConfigTable.Add((EGuideNodeID)sConfig.nGuideID, sConfig); } reader.Dispose(); reader = null; }