示例#1
0
    public static void OpenWindow(Simple2DAnimatorController animatorController)
    {
        Simple2DAnimatorControllerEditor editor = GetWindow <Simple2DAnimatorControllerEditor>();
        GUIContent titleContent = new GUIContent("• 2D Animator Controller Editor");

        editor.minSize      = new Vector2(800, 600);
        editor.titleContent = titleContent;
        editor.Init(animatorController);
    }
示例#2
0
    public override void OnInspectorGUI()
    {
        Simple2DAnimatorController t = (Simple2DAnimatorController)target;

        EditorGUILayout.Separator();
        GUI.backgroundColor = Color.magenta;
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Открыть в редакторе", Style()))
        {
            Simple2DAnimatorControllerEditor.OpenWindow(t);
        }
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        EditorGUILayout.Separator();
        GUI.backgroundColor = Color.white;
        DrawDefaultInspector();
    }