Пример #1
0
        public void LogAction(SkillLogType logType, string text, bool sendToUnityLog = false)
        {
            if (SkillExecutionStack.ExecutingAction != null)
            {
                SkillLogEntry entry = new SkillLogEntry
                {
                    Log     = this,
                    LogType = logType,
                    State   = SkillExecutionStack.ExecutingState,
                    Action  = SkillExecutionStack.ExecutingAction,
                    Text    = SkillUtility.StripNamespace(SkillExecutionStack.ExecutingAction.ToString()) + " : " + text
                };
                this.AddEntry(entry, sendToUnityLog);
                return;
            }
            switch (logType)
            {
            case SkillLogType.Info:
                Debug.Log(text);
                return;

            case SkillLogType.Warning:
                Debug.LogWarning(text);
                return;

            case SkillLogType.Error:
                Debug.LogError(text);
                return;

            default:
                Debug.Log(text);
                return;
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
        public void Log(SkillLogType logType, string text)
        {
            SkillLogEntry entry = new SkillLogEntry
            {
                Log     = this,
                LogType = logType,
                State   = SkillExecutionStack.ExecutingState,
                Text    = text
            };

            this.AddEntry(entry, false);
        }
Пример #4
0
        private void DoTimelineBar(Skill fsm, Rect area)
        {
            if (!Application.get_isPlaying())
            {
                return;
            }
            if (fsm == null)
            {
                return;
            }
            SkillLog myLog = fsm.get_MyLog();

            if (myLog == null || myLog.get_Entries() == null)
            {
                return;
            }
            GUI.BeginGroup(area);
            float      startTime = 0f;
            SkillState fsmState  = null;

            for (int i = 0; i < myLog.get_Entries().get_Count(); i++)
            {
                SkillLogEntry fsmLogEntry = myLog.get_Entries().get_Item(i);
                if (fsmLogEntry.get_LogType() == 5)
                {
                    if (fsmLogEntry.get_Time() > this.timelineControl.VisibleRangeStart)
                    {
                        this.DrawTimelineBar(startTime, fsmLogEntry.get_Time(), fsmState);
                    }
                    fsmState = null;
                }
                if (fsmLogEntry.get_LogType() == 6)
                {
                    if (fsmLogEntry.get_Time() > this.timelineControl.VisibleRangeEnd)
                    {
                        GUI.EndGroup();
                        return;
                    }
                    fsmState  = fsmLogEntry.get_State();
                    startTime = fsmLogEntry.get_Time();
                }
                SkillLogType arg_AE_0 = fsmLogEntry.get_LogType();
                SkillLogType arg_B8_0 = fsmLogEntry.get_LogType();
            }
            if (fsmState != null)
            {
                this.DrawTimelineBar(startTime, SkillTime.get_RealtimeSinceStartup(), fsmState);
            }
            GUI.EndGroup();
        }
Пример #5
0
        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);
        }