//解析模板数据 public override void parseSample(int sid) { MissionEventSample sample = new MissionEventSample(); string dataStr = getSampleDataBySid(sid); sample.parse(sid, dataStr); samples.Add(sid, sample); }
//能否执行战斗事件 public bool isDoBattleEvent() { MissionEventSample e = getPointEvent(); if (e.eventType == MissionEventType.FIGHT || e.eventType == MissionEventType.BOSS) { return(isBattlePrepared); } else { return(true); } }
public void Show(MissionEventSample _event) { iTween.ValueTo(gameObject, iTween.Hash("from", 0.001f, "to", 1f, "onupdate", "OnScale", "easetype", iTween.EaseType.easeOutElastic, "oncomplete", "ShowOver", "time", 0.6f)); if (_event.eventType == MissionEventType.BOSS) { changeImage(CardSampleManager.Instance.getRoleSampleBySid(_event.other).imageID); createBar(); } else if (_event.eventType == MissionEventType.TREASURE || _event.eventType == MissionEventType.TOW_TREASURE) { changeTreasureType(_event.other); } }
//是否是剧情事件 private bool isPlot(int e_sid) { MissionEventSample e = MissionEventSampleManager.Instance.getMissionEventSampleBySid(e_sid); if (e == null) { return(false); } if (e.eventType == MissionEventType.PLOT) { return(true); } return(false); }
//计算副本pve 总消耗 private void countMissionEventCost(MissionPointInfo point) { string[] e_ids = point.getEventArr(); int max = e_ids.Length; for (int i = 0; i < max; i++) { MissionEventSample sample = MissionEventSampleManager.Instance.getMissionEventSampleBySid(StringKit.toInt(e_ids [i])); if (sample.costType == MissionEventCostType.COST_PVE) { allCostPve += sample.cost; } } }
//执行事件回调函数 public void doEvent(bool b) { if (b) //execute_event { MissionEventSample e = getEvent(); points [p_step].gotoNextStep(); doEventCallback(e); doEvent(e); } else { MissionManager.instance.moveForward(); } }
//执行事件逻辑 private void doEvent(MissionEventSample e) { if (e == null) { return; } //跳转点 if (e.eventType == MissionEventType.SWITCH) { p_step++; } //战斗完成后讲 战斗事件 前置判定条件改为false if (e.eventType == MissionEventType.FIGHT || e.eventType == MissionEventType.BOSS) { getPlayerPoint().isBattlePrepared = false; } }
//获得当前点 事件 public MissionEventSample getPointEvent() { //步骤如果为0表示 当前点无事件 if (step == 0) { return(null); } int index = step - 1; if (e_ids == null || index >= e_ids.Length) { return(null); } int e_sid = StringKit.toInt(e_ids [index]); e = MissionEventSampleManager.Instance.getMissionEventSampleBySid(e_sid); return(e); }
////得到宝箱点位 ////_event.eventType == MissionEventType.TREASURE public List <int> getTreasurePoint() { List <int> trasureList = null; if (points == null || points.Length < 1) { return(null); } for (int i = 0; i < points.Length; i++) { MissionEventSample e = points[i].getPointEvent(); //e = MissionEventSampleManager.Instance.getMissionEventSampleBySid(e_sid); if (e.eventType == MissionEventType.TREASURE) { if (trasureList == null) { trasureList = new List <int>(); } trasureList.Add(i); } } return(trasureList); }