public void InitTaskInfo(int taskId, int times, int mathches) { sTaskId = taskId; sTimes = times; sMathches = mathches; data = ConfigReader.GetGuideHelpInfo(sTaskId); switch (taskId) { case 20001: //cp enough to buy curCheckBase = new SecondaryTaskCpEnoughCheck(); break; case 20002: //hp less back to city curCheckBase = new SecondaryTaskHpLessCheck(); break; case 20003: curCheckBase = new SecondaryTaskFullFuryCheck(); break; case 20004: curCheckBase = new SecondaryTaskOpenShopCheck(); break; default: GameMethod.DebugError("Secondary task not define"); break; } if (curCheckBase != null) { curCheckBase.OnEnter(this); } }
public void SendTaskStartTag(GuideHelpData data) { if (data == null) { return; } CEvent cEve = new CEvent((EGameEvent)data.helpTriggerEvent); EventCenter.SendEvent(cEve); }
void OnEvent(FEvent eve) { int cp = (int)eve.GetParam("Cp"); if (cp >= goalCp) { GuideHelpData data = ConfigReader.GetGuideHelpInfo(parentInfo.GetTaskId()); SecondaryGuideManager.Instance.SendTaskStartTag(data); } }
public ReadGuideHelpConfig(string xmlFilePath) { TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset; if (!xmlfile) { Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath); } xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlfile.text); XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("HelpTips").ChildNodes; for (int i = 0; i < infoNodeList.Count; i++)//(XmlNode xNode in infoNodeList) { if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null) { continue; } string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText; GuideHelpData helpInfo = new GuideHelpData(); helpInfo.helpId = Convert.ToInt32(typeName); foreach (XmlElement xEle in infoNodeList[i].ChildNodes) { #region 搜索 switch (xEle.Name) { case "tiptimes": helpInfo.helpTimes = Convert.ToInt32(xEle.InnerText); break; case "tipmatches": helpInfo.helpMatches = Convert.ToInt32(xEle.InnerText); break; case "tippath": helpInfo.helpObjPathList = GameMethod.ResolveToStrList(Convert.ToString(xEle.InnerText), ';'); break; case "tipevent": helpInfo.helpTriggerEvent = Convert.ToInt32(xEle.InnerText); break; case "tipShowTimes": helpInfo.helpShowTime = float.Parse(xEle.InnerText); break; } #endregion } ConfigReader.guideHelpXmlInfoDict.Add(helpInfo.helpId, helpInfo); } }
void OnEvent(FEvent eve) { bool tag = (bool)eve.GetParam("Tag"); GuideHelpData data = ConfigReader.GetGuideHelpInfo(parentInfo.GetTaskId()); if (tag) { SecondaryGuideManager.Instance.SendTaskStartTag(data); } else { SecondaryGuideManager.Instance.SendTaskEndTag(data); } }
void OnEvent(CEvent eve) { EFuryState state = (EFuryState)eve.GetParam("State"); GuideHelpData data = ConfigReader.GetGuideHelpInfo(parentInfo.GetTaskId()); if (state == EFuryState.eFuryFullState && curState != EFuryState.eFuryFullState) { SecondaryGuideManager.Instance.SendTaskStartTag(data); } else { SecondaryGuideManager.Instance.SendTaskEndTag(data); } curState = state; }
public void InitFinishTask(int task, int matches) { GuideHelpData data = ConfigReader.GetGuideHelpInfo(task); if (data == null || data.helpMatches <= matches) { return; } if (taskDic.ContainsKey(task)) { GameMethod.DebugError("secondary guide repeat"); return; } SecondaryTaskInfo taskInfo = new SecondaryTaskInfo(); taskInfo.InitTaskInfo(task, 0, matches); taskDic.Add(task, taskInfo); }
public void Clean() { sTaskId = 0; sTimes = 0; sMathches = 0; data = null; isFinish = false; if (taskEffect != null) { taskEffect.OnEnd(); } taskEffect = null; if (curCheckBase != null) { curCheckBase.OnEnd(); } curCheckBase = null; }
public SecondaryTaskEffect(SecondaryTaskInfo taskInfo) { owner = taskInfo; helpData = ConfigReader.GetGuideHelpInfo(owner.GetTaskId()); }
public void SendTaskEndTag(GuideHelpData data) { CEvent cEve = new CEvent((EGameEvent)(data.helpTriggerEvent + SecondaryTaskInfo.endTaskBetween)); EventCenter.SendEvent(cEve); }