Exemplo n.º 1
0
        private static void RestoreVariables(SkillLogEntry logEntry)
        {
            if (logEntry == null)
            {
                Debug.Log("Bad Log Entry!");
                return;
            }
            Skill fsm = logEntry.get_Fsm();

            if (!fsm.EnableDebugFlow)
            {
                return;
            }
            if (fsm == null)
            {
                Debug.Log("Fsm == null!!");
                return;
            }
            if (logEntry.get_FsmVariablesCopy() != null)
            {
                fsm.get_Variables().ApplyVariableValues(logEntry.get_FsmVariablesCopy());
            }
            else
            {
                Debug.LogError("Missing Local Variables Cache!");
            }
            if (logEntry.get_GlobalVariablesCopy() != null)
            {
                SkillVariables.get_GlobalVariables().ApplyVariableValues(logEntry.get_GlobalVariablesCopy());
            }
            else
            {
                Debug.LogError("Missing global Variables Cache!");
            }
            if (SkillEditor.SelectedFsm == fsm)
            {
                SkillEditor.VariableManager.UpdateView();
                GlobalVariablesWindow.UpdateView();
                SkillEditor.Repaint(false);
            }
        }