public virtual void Initialize(AbilityController abilityController) { cooldownCoroutine = CooldownTick(); Caster = abilityController; cooldown = new WaitForSeconds(abilityInformation.CooldownTime); //Call this in child class then do custom behavior. }
public static IAbilityHandler Create(IAbility[] abilities, AbilityController abilityController) { var newAbilityHandler = new AbilityHandler(); if (abilities != null) { for (int i = 0; i < abilities.Length; i++) { abilities[i].Initialize(abilityController); newAbilityHandler.AddAbility(i, abilities[i]); } } else { OutputHandler.Say("Null list received by AbilityHandler Factory."); } return(newAbilityHandler); }