Exemplo n.º 1
0
 public void UpdateScrollingText(bool isOn)
 {
     if (isOn)
     {
         scrollingText.UpdateText(text);
     }
     else
     {
         scrollingText.SetToDefaultText();
     }
 }
Exemplo n.º 2
0
    public void Init(Pawn pawn)
    {
        pawnIcon.Init(pawn);
        // Get Hero data
        HeroData heroData = DataManager.GetHeroData(pawn.type);
        // Initialize the hero's power up info
        HeroPowerUpListData powerUpListData = DataManager.GetPowerUpListData(pawn.type);
        int numPowerUpsUnlocked             = HeroPowerUpListData.GetNumPowerUpsUnlocked(pawn.level);

        for (int i = 0; i < HeroPowerUpListData.powerUpUnlockLevels.Length; i++)
        {
            // If the hero has unlocked this powerUp
            bool            locked        = i >= numPowerUpsUnlocked;
            int             unlockedLevel = HeroPowerUpListData.powerUpUnlockLevels[i];
            HeroPowerUpData data          = powerUpListData.powerUps[i].GetComponent <HeroPowerUp>().data;
            // Get the key for NewFeatureIndicator
            string newKey = GetViewedPowerKey(i);
            heroPowerUpInfoIcons[i].GetComponent <HeroPowerUpInfoIcon>().Init(data, locked, newKey, unlockedLevel);
            heroPowerUpInfoIcons[i].GetComponent <ScrollingTextOption>().scrollingText = infoText;
        }
        // Reset MidPanel Menu
        midPanelTabToggleGroup.SetAllTogglesOff();
        // Due to some stupid bug we have to wait one frame before initializing the scroll view
        StartCoroutine(ForcePosAfter1Frame());
        // Initialize the scrolling text to display info about the hero
        infoText.defaultText = heroData.heroDescription;
        infoText.SetToDefaultText();
        // Initialize NewFeatureIndicator
        newTextPowers.RegisterKey(HasPlayerViewedPowersTabKey);
        newTextAbilities.RegisterKey(HasPlayerViewedAbilitiesTabKey);
        newAbility[0].RegisterKey(GetViewedAbilityKey('0'));
        newAbility[1].RegisterKey(GetViewedAbilityKey('1'));
        newSpecial.RegisterKey(GetViewedAbilityKey('S'));

        // Initialize Abilities Panel
        abilityIcon1.GetComponent <Image>().sprite                   = heroData.abilityIcons[0];
        abilityIcon2.GetComponent <Image>().sprite                   = heroData.abilityIcons[1];
        specialAbilityIcon.GetComponent <Image>().sprite             = heroData.specialAbilityIcon;
        abilityIcon1.GetComponent <ScrollingTextOption>().text       = heroData.ability1Description;
        abilityIcon2.GetComponent <ScrollingTextOption>().text       = heroData.ability2Description;
        specialAbilityIcon.GetComponent <ScrollingTextOption>().text = heroData.specialDescription;
        abilityIcon1.GetComponent <Toggle>().isOn       = false;
        abilityIcon2.GetComponent <Toggle>().isOn       = false;
        specialAbilityIcon.GetComponent <Toggle>().isOn = false;
    }