/// <summary> /// Unassign this slot. /// </summary> public override void Unassign() { // Remove the icon base.Unassign(); // Clear the talent info this.talentInfo = null; // Clear the spell info this.spellInfo = null; }
/// <summary> /// Assign the specified slot by talentInfo and spellInfo. /// </summary> /// <param name="talentInfo">Talent info.</param> /// <param name="spellInfo">Spell info.</param> public bool Assign(UITalentInfo talentInfo, UISpellInfo spellInfo) { if (talentInfo == null || spellInfo == null) { return(false); } // Use the base class to assign the icon base.Assign(spellInfo.Icon); // Set the talent info this.talentInfo = talentInfo; // Set the spell info this.spellInfo = spellInfo; // Update the points label this.UpdatePointsLabel(); // Return success return(true); }
void Start() { if (this.slot == null) { this.slot = this.GetComponent <RnMUI_TalentSlot>(); } if (this.slot == null || this.talentDatabase == null || this.spellDatabase == null) { this.Destruct(); return; } UITalentInfo info = this.talentDatabase.GetByID(this.assignTalent); if (info != null) { this.slot.Assign(info, this.spellDatabase.GetByID(info.spellEntry)); this.slot.AddPoints(this.addPoints); } this.Destruct(); }