public void InitConfigData(GM.DataCache.ConditionGuide GuideList) { if (GuideList == null) { return; } var conditionSet = GuideList; m_GuideTable.Clear(); for (int i = 0; i < conditionSet.GuideLength; i++) { GuideStepData step = new GuideStepData(conditionSet.GetGuide(i)); m_GuideTable[step.guide_id] = step; if (step.fore_id == 0) { m_StepStartId = step.guide_id; } if (step.type == 1 && step.level > END_LEVEL) { END_LEVEL = step.level; } } m_StepEndId = FindForceGuideEndId(); }
int FindForceGuideEndId() { int end = 0; GuideStepData step_now = null; GuideStepData step_next = null; if (!GetStep(m_StepStartId, out step_now)) { return(end); } int limit = 200; while (limit > 0) { limit--; if (!GetStep(step_now.next_id, out step_next)) { break; } if (step_now.type == 1 && step_next.type != 1) { end = step_now.guide_id; break; } step_now = step_next; } return(end); }
public override void Start() { //place guide task in the first location int guideid = 0; if (GuideManager.Instance.GuideState) { guideid = GuideManager.Instance.StepCurrentId; } else if (OpenGuideManager.Instance.IsGuideReady()) { guideid = OpenGuideManager.Instance.StepCurrentId; } if (guideid != 0) { GuideStepData step = null; if (GuideManager.Instance.GetStep(guideid, out step)) { if ("NewTask_Stretch".Contains(step.view)) { SortingComparisonHandler.task_id = step.GetTask(); } } } //SortingComparisonHandler.task_id = 2006; //test SortingComparison = SortingComparisonHandler.Comparison; base.Start(); }
//通过id获得一个引导步骤的数据 public bool GetStep(int guideid, out GuideStepData step) { if (m_GuideTable.ContainsKey(guideid)) { step = m_GuideTable[guideid]; return(true); } if (guideid != 0) { EB.Debug.LogWarning("No step data for GuideID={0}", guideid); } step = null; return(false); }
public void PopFrameGuideStackEx() { if (m_StepStack.Count == 0) { return; } if (m_StepExcuteState == eStepExcuteState.Excuted) { GuideStepData step = (GuideStepData)m_StepStack.Peek(); m_StepCurrentId = step.rollback_id; m_StepProgress = m_StepCurrentId; m_StepExcuteState = eStepExcuteState.Excuting; while (m_StepStack.Count > 0) { m_StepStack.Pop(); } RemoveFxs(); } }
//通过id获得下一个引导步骤的数据 public bool GetNextStep(int guideid, out GuideStepData next) { GuideStepData now; if (!GetStep(guideid, out now)) { next = null; return(false); } if (now.next_id == 0) { next = null; m_GuideState = false; return(false); } if (!GetStep(now.next_id, out next)) { return(false); } return(true); }