/// <summary> /// Creates a button on the page with the same style as the corresponding mode select button. /// </summary> public BigButton(MenuPage page, Mode mode, bool removeAction = false) : this(page, PrefabMenuObjects.CloneBigButton(mode).button) { if (removeAction) { Button.ClearEvents(); } }
public MenuLabel(MenuPage page, string text, Vector2 dimensions) { Parent = page; (GameObject, Text, CanvasGroup) = PrefabMenuObjects.BuildDescText(Parent, text); GameObject.DestroyImmediate(GameObject.GetComponent <ContentSizeFitter>()); GameObject.DestroyImmediate(GameObject.GetComponent <AutoLocalizeTextUI>()); GameObject.DestroyImmediate(GameObject.GetComponent <FixVerticalAlign>()); Text.rectTransform.anchorMin = Text.rectTransform.anchorMax = new Vector2(0.5f, 0.5f); Text.rectTransform.sizeDelta = dimensions; }
public MenuLabel(MenuPage page, string text, Style style = Style.Title) { Parent = page; switch (style) { default: case Style.Title: (GameObject, Text, CanvasGroup) = PrefabMenuObjects.BuildLabel(Parent, text); break; case Style.Body: (GameObject, Text, CanvasGroup) = PrefabMenuObjects.BuildDescText(Parent, text); break; } }
/// <summary> /// Creates a button on the page with the specified sprite background. /// </summary> public BigButton(MenuPage page, Sprite sprite) : this(page, PrefabMenuObjects.BuildBigButtonSpriteOnly(sprite)) { }
/// <summary> /// Creates a button on the page with the specified title and sprite background. /// </summary> public BigButton(MenuPage page, Sprite sprite, string title) : this(page, PrefabMenuObjects.BuildBigButtonOneTextAndSprite(sprite, title)) { }
/// <summary> /// Creates a button on the page with the specified title, subtitle, and sprite background. /// </summary> public BigButton(MenuPage page, Sprite sprite, string title, string desc) : this(page, PrefabMenuObjects.BuildBigButtonTwoTextAndSprite(sprite, title, desc)) { }
/// <summary> /// Creates a button on the page with the specified text. /// </summary> public SmallButton(MenuPage page, string text) : base(page, PrefabMenuObjects.BuildNewButton(text)) { GameObject.transform.localScale = new Vector2(0.7f, 0.7f); Text = Button.transform.Find("Text").GetComponent <Text>(); Text.fontSize = 36; }