public void SetSpell(int spellID) { VW_MobileSpellRec record = StaticDB.vw_mobileSpellDB.GetRecord(spellID); if (record == null) { this.m_abilityNameText.text = "Err Spell ID " + spellID; Debug.LogWarning("Invalid spellID " + spellID); return; } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.SpellIconFileDataID); if (sprite != null) { this.m_abilityIcon.sprite = sprite; } else { Debug.LogWarning("Invalid or missing icon: " + record.SpellIconFileDataID); } this.m_abilityNameText.text = record.Name; SpellTooltipRec record2 = StaticDB.spellTooltipDB.GetRecord(spellID); if (record2 == null) { this.m_abilityNameText.text = "Err Tooltip ID " + spellID; Debug.LogWarning("Invalid Tooltip " + spellID); return; } this.m_abilityDescription.text = WowTextParser.parser.Parse(record2.Description, 0); }
public void SetSpell(int spellID) { this.m_spellID = spellID; VW_MobileSpellRec record = StaticDB.vw_mobileSpellDB.GetRecord(this.m_spellID); if (record == null) { this.m_spellName.text = "Err Spell ID " + this.m_spellID; Debug.LogWarning("Invalid spellID " + this.m_spellID); return; } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.SpellIconFileDataID); if (sprite != null) { this.m_spellIcon.sprite = sprite; this.m_iconError.gameObject.SetActive(false); if (this.m_grayscaleShader != null) { Material material = new Material(this.m_grayscaleShader); this.m_spellIcon.material = material; } } else { Debug.LogWarning("Invalid or missing icon: " + record.SpellIconFileDataID); this.m_iconError.gameObject.SetActive(true); this.m_iconError.text = "Missing Icon " + record.SpellIconFileDataID; } this.m_spellName.text = record.Name; }
public void SetSpell(int spellID) { this.m_spellID = spellID; VW_MobileSpellRec record = StaticDB.vw_mobileSpellDB.GetRecord(this.m_spellID); if (record == null) { this.m_spellName.set_text("Err Spell ID " + this.m_spellID); Debug.LogWarning("Invalid spellID " + this.m_spellID); return; } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.SpellIconFileDataID); if (sprite != null) { this.m_spellIcon.set_sprite(sprite); this.m_iconError.get_gameObject().SetActive(false); } else { Debug.LogWarning("Invalid or missing icon: " + record.SpellIconFileDataID); this.m_iconError.get_gameObject().SetActive(true); this.m_iconError.set_text("Missing Icon " + record.SpellIconFileDataID); } this.m_spellName.set_text(record.Name); }