コード例 #1
0
    private void CreateActionInspector(EventHandler handler)
    {
        System.Type inspectorType = GPActionInspectorManager.InspectorTypeForAction(handler.Action);

        if (inspectorType == null)
        {
            return;
        }

        m_actionInspector = (GPActionInspector)Activator.CreateInstance(inspectorType);
        m_actionInspector.TargetAction = handler.Action;
    }
コード例 #2
0
    private void DisplayActionManagementField()
    {
        EventHandler handler = (EventHandler)target;

        if (handler.Action == null)
        {
            DisplayActionCreationField();
        }
        else
        {
            DisplayActionDeleteField();
        }
    }
コード例 #3
0
    private void CreateAction()
    {
        if (m_actionTypeSelectedIndex >= GPActionManager.s_gpactionTypes.Length)
        {
            throw new Exception("Out of bound index");
        }

        EventHandler handler = (EventHandler)target;

        System.Type actionType = GPActionManager.s_gpactionTypes[m_actionTypeSelectedIndex];

        handler.Action = handler.AddAction(actionType);
    }
コード例 #4
0
    private void DeleteAction()
    {
        EventHandler handler = (EventHandler)target;

        if (handler.Action == null)
        {
            return;
        }

        if (EditorUtility.DisplayDialog("Confirm Delete",
                                        "Are you sure you want to delete this action ? " +
                                        "This can not be undone!",
                                        "Confirm", "Cancel"))
        {
            handler.GetGPActionObjectMapperOrCreate().ResetGPActionObjectHolder(handler);
        }
    }
コード例 #5
0
    public override void OnInspectorGUI()
    {
        EventHandler handler = (EventHandler)target;

        // Display Default MonoBehaviour editor

        base.OnInspectorGUI();

        // Display Handler Kind popup

        EditorGUILayout.Space();

        EditorGUILayout.LabelField("State: " + handler.State.ToString());

        if (EditorApplication.isPlaying && GUILayout.Button("Debug Trigger"))
        {
            handler.EventTrigger(new GPEvent {
                EventID = handler._eventID
            });
        }
    }