public static ASkill GetSkill(SkillType p_skillType, params object[] p_parameters) { ASkill skill = null; switch (p_skillType) { case SkillType.HitSingleCharacter: Assert.IsTrue(p_parameters.Length == 2); skill = new HitSingleCharacterSkill((GameObject)p_parameters[0], (int)p_parameters[1]); break; case SkillType.HealSingleCharacter: Assert.IsTrue(p_parameters.Length == 3); skill = new HealSingleCharacterSkill((GameObject)p_parameters[0], (float)p_parameters[1], (float)p_parameters[2]); break; default: Debug.Log("The type " + p_skillType.ToString() + " is not implemented."); break; } return(skill); }
void Awake() { AttributeManager attributeManager = GetComponent <AttributeManager>(); attributeManager.AddAttribute(AttributeType.Mana, new ResourceModifier.Attribute(100, 0, 1000)); attributeManager.AddAttribute(AttributeType.ManaMax, new BasicAttribute(150, 0, 1000)); attributeManager.AddAttribute(AttributeType.ManaRegen, new BasicAttribute(0.5f, 0, 100)); attributeManager.AddAttribute(AttributeType.HealPower, new BasicAttribute(50, 0, 1000)); attributeManager.AddModifier(Factory.GetModifier(AttributModifierType.Resource, gameObject, new ResourceModifier.Params(AttributeType.ManaRegen, AttributeType.ManaMax, AttributeType.Mana))); SkillGroup progressTrackerProvider = GetComponent <SkillGroup>(); GameObject progressTracker = progressTrackerProvider.CreateSkill(DataManager.Instance.CreateDisplaySkillData(SkillType.HealSingleCharacter)); ASkillController skillController = progressTracker.GetComponent <ASkillController>(); ASkill skill = new HealSingleCharacterSkill(gameObject, 3f, 50f); skillController.Skill = new InteractionSkill(new SelectCharacterInteraction(this), skill); skillController.ProgressTracker = progressTracker.GetComponent <IProgressTracker>(); }