/// <summary> /// Removes the skill gameobject and destroy it. /// </summary> public void RemoveSkill() { if (SkillAttached) { Skill = null; SkillData = null; Destroy(SkillObject); InitializeSkill(); SkillAttached = false; } }
/// <summary> /// Attached the skill object as the child and set the skill data for rendering the skill /// </summary> /// <param name="pSkill">P skill.</param> public void SetSkill(GameObject pSkillObject) { if (!SkillAttached) { SkillObject = pSkillObject; pSkillObject.transform.SetParent(gameObject.transform); Skill = pSkillObject.GetComponent <Skill> (); SkillData = Skill.SkillInfo; InitializeSkill(); SkillAttached = true; } }