Пример #1
0
 public static void OpenAction(SkillStateAction action, bool openState)
 {
     if (action == null)
     {
         return;
     }
     action.set_IsOpen(openState);
     SkillEditor.SaveActions(action.get_State(), false);
 }
Пример #2
0
 public static void EnableAction(SkillStateAction action, bool enabledState)
 {
     if (action == null)
     {
         return;
     }
     SkillEditor.RegisterUndo(Strings.get_Command_Enable_Action());
     action.set_Enabled(enabledState);
     SkillEditor.SaveActions(action.get_State(), true);
 }
Пример #3
0
 public static void RenameAction(SkillStateAction action, string newName)
 {
     if (action == null)
     {
         return;
     }
     SkillEditor.RegisterUndo(Strings.get_Command_Rename_Action());
     action.set_Name(newName);
     SkillEditor.SaveActions(action.get_State(), false);
     Actions.UpdateTooltip(action);
 }
Пример #4
0
 public static void ResetActionName(SkillStateAction action)
 {
     if (action == null)
     {
         return;
     }
     SkillEditor.RegisterUndo(Strings.get_Command_Reset_Action_Name());
     action.set_Name(action.get_IsAutoNamed() ? action.AutoName() : null);
     SkillEditor.SaveActions(action.get_State(), false);
     Actions.UpdateTooltip(action);
 }
Пример #5
0
 public static void ResetAction(SkillStateAction action)
 {
     if (action == null)
     {
         return;
     }
     SkillEditor.RegisterUndo(Strings.get_Command_Reset_Action());
     Keyboard.ResetFocus();
     action.Reset();
     SkillEditor.SaveActions(action.get_State(), true);
     Actions.UpdateTooltip(action);
 }
Пример #6
0
        public static void MoveActionAfter(SkillState state, SkillStateAction action, SkillStateAction afterAction)
        {
            if (state == null || action == null || afterAction == null)
            {
                return;
            }
            List <SkillStateAction> list = new List <SkillStateAction>(state.get_Actions());

            list.Remove(action);
            int num = Mathf.Clamp(list.IndexOf(afterAction) + 1, 0, list.get_Count());

            list.Insert(num, action);
            state.set_Actions(list.ToArray());
            SkillEditor.SaveActions(action.get_State(), false);
        }
Пример #7
0
        public static void MoveActionToTop(SkillState state, SkillStateAction action)
        {
            if (state == null || action == null)
            {
                return;
            }
            List <SkillStateAction> list = new List <SkillStateAction>(state.get_Actions());

            if (list.IndexOf(action) == 0)
            {
                return;
            }
            SkillEditor.RegisterUndo(Strings.get_Menu_Move_Action_To_Top());
            list.Remove(action);
            list.Insert(0, action);
            state.set_Actions(list.ToArray());
            SkillEditor.SaveActions(action.get_State(), false);
        }
Пример #8
0
        public static void MoveActionToBottom(SkillState state, SkillStateAction action)
        {
            if (state == null || action == null)
            {
                return;
            }
            List <SkillStateAction> list = new List <SkillStateAction>(state.get_Actions());
            int num = list.IndexOf(action);

            if (num == state.get_Actions().Length - 1)
            {
                return;
            }
            SkillEditor.RegisterUndo(Strings.get_Menu_Move_Action_To_Bottom());
            list.Remove(action);
            list.Add(action);
            state.set_Actions(list.ToArray());
            SkillEditor.SaveActions(action.get_State(), false);
        }
Пример #9
0
        public static void MoveActionDown(SkillState state, SkillStateAction action)
        {
            if (state == null || action == null)
            {
                return;
            }
            List <SkillStateAction> list = new List <SkillStateAction>(state.get_Actions());
            int num = list.IndexOf(action);

            if (num == state.get_Actions().Length - 1)
            {
                return;
            }
            SkillEditor.RegisterUndo(Strings.get_Command_Move_Action_Down());
            list.Remove(action);
            list.Insert(num + 1, action);
            state.set_Actions(list.ToArray());
            SkillEditor.SaveActions(action.get_State(), false);
        }