Ejemplo n.º 1
0
            static public GameObject SpawnBlackButton(GameObject parent, Vector2 givenSize, string givenLabel, List <TMPro.TextMeshProUGUI> texts, bool isFallback = false)
            {
                ColorBlock colourBlockA = new ColorBlock();

                colourBlockA.disabledColor    = new Color(1, 1, 1, 1);
                colourBlockA.highlightedColor = new Color(1, 1, 1, 1);
                colourBlockA.normalColor      = new Color(1, 1, 1, 1);
                colourBlockA.pressedColor     = new Color(1, 1, 1, 1);
                colourBlockA.colorMultiplier  = 1;

                ColorBlock colourBlockB = new ColorBlock();

                colourBlockB.disabledColor    = new Color(0.094f, 0.094f, 0.094f, 0.286f);
                colourBlockB.highlightedColor = new Color(0.300f, 0.300f, 0.300f, 1.00f);
                colourBlockB.normalColor      = new Color(0.300f, 0.300f, 0.300f, 1.00f);
                colourBlockB.pressedColor     = new Color(0.500f, 0.500f, 0.500f, 1.000f);
                colourBlockB.colorMultiplier  = 1;

                GameObject buttonA = ElementCreator.SpawnButtonSize(parent, Resources.panelTextures[4], colourBlockA, new Vector2(0, 1), givenSize);
                GameObject buttonB = ElementCreator.SpawnButtonOffset(buttonA, Resources.panelTextures[3], colourBlockB, isFallback);

                buttonA.GetComponent <RoR2.UI.HGButton>().interactable = false;
                Image highlightImageA = ElementCreator.SpawnImageOffset(new List <Image>(), buttonA, Resources.panelTextures[2], new Color(1, 1, 1, 1), new Vector2(0.5f, 0.5f), new Vector2(-4, -12), new Vector2(12, 4));

                buttonA.GetComponent <RoR2.UI.HGButton>().imageOnHover = buttonB.GetComponent <Image>();
                buttonB.GetComponent <RoR2.UI.HGButton>().imageOnHover = highlightImageA;
                ElementCreator.SpawnTextOffset(texts, buttonA, new Color(1, 1, 1, 1), 24, 0, new Vector2(12, 4), new Vector2(-12, -4));
                texts[0].text = givenLabel;
                return(buttonB);
            }