Beispiel #1
0
 /// <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();
     }
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
 /// <summary>
 /// Creates a button on the page with the specified sprite background.
 /// </summary>
 public BigButton(MenuPage page, Sprite sprite)
     : this(page, PrefabMenuObjects.BuildBigButtonSpriteOnly(sprite))
 {
 }
Beispiel #5
0
 /// <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))
 {
 }
Beispiel #6
0
 /// <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))
 {
 }
Beispiel #7
0
 /// <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;
 }