public void Initialize(Hero hero, HeroDetailsInterface heroInterface) { this.hero = hero; this.heroInterface = heroInterface; // Fade the Shadow in fader.color = new Color(0f, 0f, 0f, 0f); fader.DOColor(new Color(0f, 0f, 0f, 0.7f), 0.3f); // Transition the panel in RevealPanel.localScale = Vector3.zero; RevealPanel.DOScale(1f, 0.4f); // Skip worrying about UI configuration ResetStars(); AwakenContainer.gameObject.SetActive(false); // Spawn hero UI element heroRef = Instantiate(hero.LoadUIAnimationReference(), ModelContainer); RectTransform heroRT = heroRef.GetComponent <RectTransform>(); heroRT.anchorMin = new Vector2(0.5f, 0f); heroRT.anchorMax = new Vector2(0.5f, 0f); heroRT.pivot = new Vector2(0.5f, 0f); heroRT.anchoredPosition = new Vector2(0f, 50f); heroRT.localScale *= 2.5f; if (hero.isAscended) { AcceptButton.gameObject.SetActive(false); CancelButton.gameObject.SetActive(false); ContinueButton.gameObject.SetActive(true); StarContainer.gameObject.SetActive(false); AwakenText.text = "Limit Reached"; AwakenContainer.gameObject.SetActive(true); // Swap out requirement icons MaterialRequiredAmount.text = "None"; RelicRequiredAmount.text = "None"; RelicRequiredAmount.color = Color.white; MaterialRequiredAmount.color = Color.white; RelicRequiredIcon.sprite = null; MaterialRequiredIcon.sprite = null; RelicRequiredIcon.color = new Color(0.3f, 0.3f, 0.3f, 1f); MaterialRequiredIcon.color = new Color(0.3f, 0.3f, 0.3f, 1f); } else { // Required Relic Checks and display code CurrencyTypes relicType = CurrencyTypes.RELICS_SWORD; switch (hero.data.Class) { case HeroClass.Assassin: relicType = CurrencyTypes.RELICS_BOW; break; case HeroClass.Tank: relicType = CurrencyTypes.RELICS_SHIELD; break; case HeroClass.Mage: relicType = CurrencyTypes.RELICS_STAFF; break; default: case HeroClass.Bruiser: // Already set to sword break; } RelicRequiredIcon.sprite = IconReferenceList[hero.data.Class]; CurrencyManager.ColorizeSlashText(relicType, 1, RelicRequiredAmount, AcceptButton); // Required Material Checks and display code Debug.Log("Hero Quality: [" + hero.Quality.ToString() + "]\n"); int currencyCount = 0; bool hasEnoughCurrency = false; switch (hero.Quality) { case HeroQuality.Common: currencyCount = CurrencyTypes.ESSENCE_LOW.GetAmount(); MaterialRequiredIcon.sprite = Resources.Load <Sprite>("Items/Essences/low_essence"); MaterialRequiredAmount.text = currencyCount + "/25"; if (currencyCount >= 25) { hasEnoughCurrency = true; } SetCurrentStars(1); SetTargetStars(2); break; case HeroQuality.Rare: currencyCount = CurrencyTypes.ESSENCE_MID.GetAmount(); MaterialRequiredIcon.sprite = Resources.Load <Sprite>("Items/Essences/medium_essence"); MaterialRequiredAmount.text = currencyCount + "/15"; if (currencyCount >= 15) { hasEnoughCurrency = true; } SetCurrentStars(2); SetTargetStars(3); break; case HeroQuality.Legendary: currencyCount = CurrencyTypes.ESSENCE_HIGH.GetAmount(); MaterialRequiredIcon.sprite = Resources.Load <Sprite>("Items/Essences/high_essence"); MaterialRequiredAmount.text = currencyCount + "/15"; if (currencyCount >= 15) { hasEnoughCurrency = true; } // Awaken test show StarContainer.gameObject.SetActive(false); AwakenContainer.gameObject.SetActive(true); break; } if (!hasEnoughCurrency) { // Disable the accept button AcceptButton.interactable = false; MaterialRequiredAmount.color = Color.red; } else { MaterialRequiredAmount.color = Color.white; } if (!hero.isMaxLevel()) { AcceptButton.interactable = false; AwakenText.text = "Not Max Level"; AwakenText.color = Color.red; StarContainer.gameObject.SetActive(false); AwakenContainer.gameObject.SetActive(true); } } if (!PlayerPrefs.HasKey("tutorial_hero_upgrades")) { StoryManager.Instance.DisplayStory("story_tutorial_hero_upgrades"); PlayerPrefs.SetInt("tutorial_hero_upgrades", 1); } }