Exemple #1
0
        /// <summary>
        /// Unassign this slot.
        /// </summary>
        public override void Unassign()
        {
            // Remove the icon
            base.Unassign();

            // Clear the talent info
            this.m_TalentInfo = null;

            // Clear the spell info
            this.m_SpellInfo = null;
        }
Exemple #2
0
		/// <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
			this.Assign(spellInfo.Icon);
			
			// Set the talent info
			this.m_TalentInfo = talentInfo;
			
			// Set the spell info
			this.m_SpellInfo = spellInfo;
			
			// Update the points label
			this.UpdatePointsLabel();
			
			// Return success
			return true;
		}
        void Start()
        {
            if (this.slot == null)
            {
                this.slot = this.GetComponent <UITalentSlot>();
            }

            if (this.slot == null || UITalentDatabase.Instance == null || UISpellDatabase.Instance == null)
            {
                this.Destruct();
                return;
            }

            UITalentInfo info = UITalentDatabase.Instance.GetByID(this.assignTalent);

            if (info != null)
            {
                this.slot.Assign(info, UISpellDatabase.Instance.GetByID(info.spellEntry));
                this.slot.AddPoints(this.addPoints);
            }

            this.Destruct();
        }