Example #1
0
        public static ActionReport Log(PlayMakerFSM fsm, FsmState state, FsmStateAction action, int actionIndex, string parameter, string logLine, bool isError = false)
        {
            if (!PlayMakerGlobals.IsEditor)
            {
                return(null);
            }
            ActionReport actionReport = new ActionReport();

            actionReport.fsm         = fsm;
            actionReport.state       = state;
            actionReport.action      = action;
            actionReport.actionIndex = actionIndex;
            actionReport.parameter   = parameter;
            actionReport.logText     = logLine;
            actionReport.isError     = isError;
            ActionReport actionReport2 = actionReport;

            if (!ActionReportContains(actionReport2))
            {
                ActionReportList.Add(actionReport2);
                InfoCount++;
                return(actionReport2);
            }
            return(null);
        }
Example #2
0
        public static ActionReport Log(PlayMakerFSM fsm, SkillState state, SkillStateAction action, int actionIndex, string parameter, string logLine, bool isError = false)
        {
            if (!PlayMakerGlobals.IsEditor)
            {
                return(null);
            }
            ActionReport actionReport = new ActionReport
            {
                fsm         = fsm,
                state       = state,
                action      = action,
                actionIndex = actionIndex,
                parameter   = parameter,
                logText     = logLine,
                isError     = isError
            };

            if (!ActionReport.ActionReportContains(actionReport))
            {
                ActionReport.ActionReportList.Add(actionReport);
                ActionReport.InfoCount++;
                return(actionReport);
            }
            return(null);
        }
Example #3
0
 private bool SameAs(ActionReport actionReport)
 {
     if (object.ReferenceEquals(actionReport.fsm, fsm) && actionReport.state == state && actionReport.actionIndex == actionIndex && actionReport.logText == logText && actionReport.isError == isError)
     {
         return(actionReport.parameter == parameter);
     }
     return(false);
 }
Example #4
0
 private static bool ActionReportContains(ActionReport report)
 {
     foreach (ActionReport actionReport in ActionReportList)
     {
         if (actionReport.SameAs(report))
         {
             return(true);
         }
     }
     return(false);
 }
Example #5
0
 private static bool ActionReportContains(ActionReport report)
 {
     using (List <ActionReport> .Enumerator enumerator = ActionReport.ActionReportList.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             ActionReport current = enumerator.get_Current();
             if (current.SameAs(report))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Example #6
0
 public static void LogError(PlayMakerFSM fsm, SkillState state, SkillStateAction action, int actionIndex, string logLine)
 {
     ActionReport.Log(fsm, state, action, actionIndex, logLine, "", true);
     Debug.LogError(SkillUtility.GetPath(state, action) + logLine, fsm);
     ActionReport.ErrorCount++;
 }
Example #7
0
 private bool SameAs(ActionReport actionReport)
 {
     return(object.ReferenceEquals(actionReport.fsm, this.fsm) && actionReport.state == this.state && actionReport.actionIndex == this.actionIndex && actionReport.logText == this.logText && actionReport.isError == this.isError && actionReport.parameter == this.parameter);
 }