예제 #1
0
        public static void DeleteStateTransitionArrowLine(StateTransitionArrowLine line)
        {
            bool res = StateTransitionArrowLineDataControl.DeleteStateTransitionArrowLine(line);

            if (res)
            {
                if (StateMachineEditorWindow.OnDeleteStateTransitionArrowLine != null)
                {
                    StateMachineEditorWindow.OnDeleteStateTransitionArrowLine(line);
                }
            }
        }
 public static bool DeleteMachineStateGUI(MachineStateGUI state)
 {
     if (allMachineStateGUI.Contains(state))
     {
         List <StateTransitionArrowLine> lineList = new List <StateTransitionArrowLine>();
         lineList.AddRange(state.FromArrowLines);
         lineList.AddRange(state.ToArrowLines);
         foreach (var item in lineList)
         {
             StateTransitionArrowLineDataControl.DeleteStateTransitionArrowLine(item);
         }
         lineList.Clear();
         StateMachineDataControl.DeleteMachineState(state.state);
         allMachineStateGUI.Remove(state);
         return(true);
     }
     return(false);
 }
예제 #3
0
 public static void DeleteStateTransition(StateTransitionArrowLine line, StateTransition st)
 {
     if (line.transitions.Contains(st))
     {
         if (line.transitions.Count == 1)
         {
             StateTransitionArrowLineDataControl.DeleteStateTransitionArrowLine(line);
         }
         else
         {
             StateTransitionDataControl.DeleteStateTransition(st);
             line.transitions.Remove(st);
         }
         if (StateMachineEditorWindow.OnDeleteStateTransition != null)
         {
             StateMachineEditorWindow.OnDeleteStateTransition(st);
         }
     }
 }