示例#1
0
        private static void TransitionTools()
        {
            ToolWindow.Header(Strings.get_ToolWindow_Header_Transition_Tools());
            SkillState      selectedState      = SkillEditor.SelectedState;
            SkillTransition selectedTransition = SkillEditor.SelectedTransition;

            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label(Strings.get_Label_Event(), new GUILayoutOption[]
            {
                GUILayout.MaxWidth(40f)
            });
            if (GUILayout.Button(Labels.GetEventLabel(selectedTransition), EditorStyles.get_popup(), new GUILayoutOption[0]))
            {
                ToolWindow.editingTransition = selectedTransition;
                SkillEditorGUILayout.GenerateEventSelectionMenu(SkillEditor.SelectedFsm, selectedTransition.get_FsmEvent(), new GenericMenu.MenuFunction2(ToolWindow.SelectEvent), new GenericMenu.MenuFunction(SkillEditor.OpenEventManager)).ShowAsContext();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label(Strings.get_Label_State(), new GUILayoutOption[]
            {
                GUILayout.MaxWidth(40f)
            });
            if (GUILayout.Button(Labels.GetStateLabel(selectedTransition.get_ToState()), EditorStyles.get_popup(), new GUILayoutOption[0]))
            {
                ToolWindow.editingTransition = selectedTransition;
                SkillEditorGUILayout.GenerateStateSelectionMenu(SkillEditor.SelectedFsm, selectedTransition.get_ToState(), new GenericMenu.MenuFunction2(ToolWindow.SelectToState)).ShowAsContext();
            }
            GUILayout.EndHorizontal();
            if (GUILayout.Button(Strings.get_Command_Delete(), new GUILayoutOption[0]))
            {
                EditorCommands.DeleteTransition(selectedState, selectedTransition);
                SkillEditor.Selection.SelectTransition(null);
                SkillEditor.RepaintAll();
            }
        }
 public static void DeleteSelectedTransition()
 {
     EditorCommands.DeleteTransition(SkillEditor.SelectedState, SkillEditor.SelectedTransition);
 }