static public InstantGuiPopup CreatePopup() { InstantGuiPopup element = (InstantGuiPopup)InstantGuiElement.Create("Popup", typeof(InstantGuiPopup), GetSelectedElement()); element.list = CreateList(); //element.list.useStylePlacement = true; element.list.transform.parent = element.transform; element.list.relative.Set(0, 100, 100, 100); element.list.offset.Set(0, 0, 0, 200); //element.diamond = InstantGuiElement.Create("Slider_Diamond", InstantGuiElement, element); //element.incrementButton = InstantGuiElement.Create("Slider_IncrementButton", InstantGuiElement, element); //element.decrementButton = InstantGuiElement.Create("Slider_DecrementButton", InstantGuiElement, element); InstantGui.ForceUpdate(); Selection.activeGameObject = element.gameObject; return(element); }
public override void OnInspectorGUI() { InstantGuiPopup script = (InstantGuiPopup)target; base.OnInspectorGUI(); //EditorGUILayout.Space(); script.guiElementProps = EditorGUILayout.Foldout(script.guiElementProps, "Popup"); if (script.guiElementProps) { EditorGUI.indentLevel = 2; script.selected = EditorGUILayout.IntField("Selected:", script.selected); script.list = (InstantGuiList)EditorGUILayout.ObjectField("List:", script.list, typeof(InstantGuiList), true); EditorGUI.indentLevel = 0; } }