private static SkillLogEntry FindPrevLogEntry(SkillLogEntry fromEntry, SkillLogType logType = 6) { if (fromEntry == null) { return(null); } SkillLog log = fromEntry.get_Log(); if (log == null || log.get_Entries() == null) { return(null); } SkillLogEntry result = null; using (List <SkillLogEntry> .Enumerator enumerator = log.get_Entries().GetEnumerator()) { while (enumerator.MoveNext()) { SkillLogEntry current = enumerator.get_Current(); if (current == fromEntry) { break; } if (current.get_LogType() == logType) { result = current; } } } return(result); }
public static void SelectLogEntry(SkillLogEntry logEntry, bool updateTime = true) { if (logEntry != null) { DebugFlow.SelectedLog = logEntry.get_Log(); DebugFlow.SelectedLogEntry = logEntry; DebugFlow.DebugState = logEntry.get_State(); DebugFlow.SelectedLogEntryIndex = logEntry.GetIndex(); if (updateTime) { DebugFlow.CurrentDebugTime = logEntry.get_Time(); DebugFlow.CurrentDebugFrame = logEntry.get_FrameCount(); } SkillEditor.SelectState(logEntry.get_State(), true); if (logEntry.get_Action() != null) { SkillEditor.SelectAction(logEntry.get_Action(), true); } if (FsmEditorSettings.EnableDebugFlow && DebugFlow.SelectedLog.get_Fsm().EnableDebugFlow&& DebugFlow.SelectedLogEntryIndex < DebugFlow.lastEnterIndex) { DebugFlow.RestoreNearestVariables(logEntry); } if (DebugFlow.LogEntrySelected != null) { DebugFlow.LogEntrySelected(logEntry); } SkillEditor.Repaint(true); } }
private static SkillLogEntry FindNextLogEntry(SkillLogEntry fromEntry, params SkillLogType[] logTypes) { SkillLog log = fromEntry.get_Log(); if (log == null) { return(null); } int num = DebugFlow.SelectedLog.get_Entries().IndexOf(fromEntry); for (int i = num + 1; i < log.get_Entries().get_Count(); i++) { SkillLogEntry fsmLogEntry = log.get_Entries().get_Item(i); for (int j = 0; j < logTypes.Length; j++) { SkillLogType fsmLogType = logTypes[j]; if (fsmLogEntry.get_LogType() == fsmLogType) { return(fsmLogEntry); } } } return(null); }