Exemple #1
0
 private void boldClass(ClassCount classC, Button b, int lvl)
 {
     classC.initDefinition(lvl);
     b.GetComponent <SynergyButton>().setTooltipDef(classC.getString());
 }
Exemple #2
0
    private Color colorLvlMax  = new Color(1f, 0, 0, 163f / 255f);//Color.red;

    private void Awake()
    {
        //Singleton creation
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        //synergyText = GetComponent<TextMeshProUGUI>();

        rc.Add(orcs);
        rc.Add(skeletons);
        rc.Add(octopus);
        rc.Add(elementals);
        rc.Add(giants);
        rc.Add(ratmen);
        rc.Add(demons);

        cc.Add(mages);
        cc.Add(warriors);
        cc.Add(tanks);
        cc.Add(bowmans);
        cc.Add(healers);
        cc.Add(supports);
        cc.Add(berserkers);
        cc.Add(assassins);

        orcButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        orcButton.GetComponent <SynergyButton>().setTooltipDef(orcs.getString());
        orcButton.gameObject.SetActive(false);

        skeletonButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        skeletonButton.GetComponent <SynergyButton>().setTooltipDef(skeletons.getString());
        skeletonButton.gameObject.SetActive(false);

        octopusButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        octopusButton.GetComponent <SynergyButton>().setTooltipDef(octopus.getString());
        octopusButton.gameObject.SetActive(false);

        elementalButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        elementalButton.GetComponent <SynergyButton>().setTooltipDef(elementals.getString());
        elementalButton.gameObject.SetActive(false);

        giantButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        giantButton.GetComponent <SynergyButton>().setTooltipDef(giants.getString());
        giantButton.gameObject.SetActive(false);

        ratmanButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        ratmanButton.GetComponent <SynergyButton>().setTooltipDef(ratmen.getString());
        ratmanButton.gameObject.SetActive(false);

        demonButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        demonButton.GetComponent <SynergyButton>().setTooltipDef(demons.getString());
        demonButton.gameObject.SetActive(false);


        mageButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        mageButton.GetComponent <SynergyButton>().setTooltipDef(mages.getString());
        mageButton.gameObject.SetActive(false);

        warriorButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        warriorButton.GetComponent <SynergyButton>().setTooltipDef(warriors.getString());
        warriorButton.gameObject.SetActive(false);

        tankButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        tankButton.GetComponent <SynergyButton>().setTooltipDef(tanks.getString());
        tankButton.gameObject.SetActive(false);

        bowmanButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        bowmanButton.GetComponent <SynergyButton>().setTooltipDef(bowmans.getString());
        bowmanButton.gameObject.SetActive(false);

        healerButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        healerButton.GetComponent <SynergyButton>().setTooltipDef(healers.getString());
        healerButton.gameObject.SetActive(false);

        supportButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        supportButton.GetComponent <SynergyButton>().setTooltipDef(supports.getString());
        supportButton.gameObject.SetActive(false);

        berserkerButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        berserkerButton.GetComponent <SynergyButton>().setTooltipDef(berserkers.getString());
        berserkerButton.gameObject.SetActive(false);

        assassinButton = Instantiate(ButtonSynergy, GetComponent <RectTransform>());
        assassinButton.GetComponent <SynergyButton>().setTooltipDef(assassins.getString());
        assassinButton.gameObject.SetActive(false);
    }