Beispiel #1
0
    static public InstantGuiWindow CreateWindow()
    {
        InstantGuiWindow element = (InstantGuiWindow)InstantGuiElement.Create("Window", typeof(InstantGuiWindow), GetSelectedElement());

        element.closeButton = InstantGuiElement.Create("Window_CloseButton", typeof(InstantGuiElement), element);
        element.closeButton.useStylePlacement = true;
        InstantGui.ForceUpdate();
        Selection.activeGameObject = element.gameObject;
        return(element);
    }
    public override void  OnInspectorGUI()
    {
        InstantGuiWindow script = (InstantGuiWindow)target;

        base.OnInspectorGUI();
        //EditorGUILayout.Space();

        //DrawActivator ("On Pressed:", script.onPressed);

        script.guiElementProps = EditorGUILayout.Foldout(script.guiElementProps, "Window");
        if (script.guiElementProps)
        {
            EditorGUI.indentLevel = 2;
            script.movable        = EditorGUILayout.Toggle("Movable", script.movable);
            script.scape          = (InstantGuiWindowScape)EditorGUILayout.EnumPopup("Move Scape:", script.scape);
            script.closeButton    = (InstantGuiElement)EditorGUILayout.ObjectField("Close Button:", script.closeButton, typeof(InstantGuiElement), true);
            //script.expandButton = (InstantGuiElement)EditorGUILayout.ObjectField("Expand Button:", script.expandButton, typeof(InstantGuiElement), true);
            EditorGUI.indentLevel = 0;
        }
    }