public override void ShowGUI(Menu menu) { MenuSource source = menu.menuSource; if (source != MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("This Element type is not necessary in Unity's UI, as it can be recreated using ScrollBars and ScrollRects.", MessageType.Info); return; } EditorGUILayout.BeginVertical("Button"); label = EditorGUILayout.TextField("Button text:", label); anchor = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor); textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects); dragType = (DragElementType)EditorGUILayout.EnumPopup("Drag type:", dragType); if (dragType == DragElementType.SingleElement) { elementName = EditorGUILayout.TextField("Element name:", elementName); } dragRect = EditorGUILayout.RectField("Drag boundary:", dragRect); EditorGUILayout.EndVertical(); base.ShowGUI(menu); }
public override void ShowGUI(Menu menu) { string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuDrag)"; MenuSource source = menu.menuSource; if (source != MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("This Element type is not necessary in Unity's UI, as it can be recreated using ScrollBars and ScrollRects.", MessageType.Info); return; } CustomGUILayout.BeginVertical(); label = CustomGUILayout.TextField("Button text:", label, apiPrefix + ".label", "The text that's displayed on-screen"); anchor = (TextAnchor)CustomGUILayout.EnumPopup("Text alignment:", anchor, apiPrefix + ".anchor", "The text alignment"); textEffects = (TextEffects)CustomGUILayout.EnumPopup("Text effect:", textEffects, apiPrefix + ".textEffects", "The special FX applied to the text"); dragType = (DragElementType)CustomGUILayout.EnumPopup("Drag type:", dragType, apiPrefix + ".dragType", "What the MenuDrag can be used to move"); if (dragType == DragElementType.SingleElement) { elementName = CustomGUILayout.TextField("Element name:", elementName, apiPrefix + ".elementName", "The name of the element (within the same menu) that can be dragged"); } dragRect = EditorGUILayout.RectField(new GUIContent("Drag boundary:", "The boundary that the " + dragType.ToString().ToLower() + " can be moved within"), dragRect); ChangeCursorGUI(menu); CustomGUILayout.EndVertical(); base.ShowGUI(menu); }
public override void ShowGUI(Menu menu) { string apiPrefix = "AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\")"; MenuSource source = menu.menuSource; if (source != MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("This Element type is not necessary in Unity's UI, as it can be recreated using ScrollBars and ScrollRects.", MessageType.Info); return; } EditorGUILayout.BeginVertical("Button"); label = CustomGUILayout.TextField("Button text:", label, apiPrefix + ".label"); anchor = (TextAnchor)CustomGUILayout.EnumPopup("Text alignment:", anchor, apiPrefix + ".anchor"); textEffects = (TextEffects)CustomGUILayout.EnumPopup("Text effect:", textEffects, apiPrefix + ".textEffects"); dragType = (DragElementType)CustomGUILayout.EnumPopup("Drag type:", dragType, apiPrefix + ".dragType"); if (dragType == DragElementType.SingleElement) { elementName = CustomGUILayout.TextField("Element name:", elementName, apiPrefix + ".elementName"); } dragRect = EditorGUILayout.RectField("Drag boundary:", dragRect); EditorGUILayout.EndVertical(); base.ShowGUI(menu); }
private void CopyDrag(MenuDrag _element) { label = _element.label; anchor = _element.anchor; textEffects = _element.textEffects; dragRect = _element.dragRect; dragType = _element.dragType; elementName = _element.elementName; base.Copy(_element); }
public void CopyDrag(MenuDrag _element) { label = _element.label; anchor = _element.anchor; textEffects = _element.textEffects; dragRect = _element.dragRect; dragType = _element.dragType; elementName = _element.elementName; base.Copy (_element); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { label = "Button"; isVisible = true; isClickable = true; textEffects = TextEffects.None; numSlots = 1; anchor = TextAnchor.MiddleCenter; SetSize(new Vector2(10f, 5f)); dragRect = new Rect(0, 0, 0, 0); dragType = DragElementType.EntireMenu; elementName = ""; base.Declare(); }
public override void Declare () { label = "Button"; isVisible = true; isClickable = true; textEffects = TextEffects.None; numSlots = 1; anchor = TextAnchor.MiddleCenter; SetSize (new Vector2 (10f, 5f)); dragRect = new Rect (0,0,0,0); dragType = DragElementType.EntireMenu; elementName = ""; base.Declare (); }
public override void ShowGUI () { EditorGUILayout.BeginVertical ("Button"); label = EditorGUILayout.TextField ("Button text:", label); anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); dragType = (DragElementType) EditorGUILayout.EnumPopup ("Drag type:", dragType); if (dragType == DragElementType.SingleElement) { elementName = EditorGUILayout.TextField ("Element name:", elementName); } dragRect = EditorGUILayout.RectField ("Drag boundary:", dragRect); EditorGUILayout.EndVertical (); base.ShowGUI (); }
public override void ShowGUI(MenuSource source) { if (source != MenuSource.AdventureCreator) { EditorGUILayout.HelpBox ("This Element type is not necessary in Unity's UI, as it can be recreated using ScrollBars and ScrollRects.", MessageType.Info); return; } EditorGUILayout.BeginVertical ("Button"); label = EditorGUILayout.TextField ("Button text:", label); anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); dragType = (DragElementType) EditorGUILayout.EnumPopup ("Drag type:", dragType); if (dragType == DragElementType.SingleElement) { elementName = EditorGUILayout.TextField ("Element name:", elementName); } dragRect = EditorGUILayout.RectField ("Drag boundary:", dragRect); EditorGUILayout.EndVertical (); base.ShowGUI (source); }