public void AddAbility(AbilityBaseTriggerable ability, int slot) { ClearAbility(slot); abilities[slot] = ability; abilityIconGO[slot].sprite = abilities[slot].ButtonImage; darkMask[slot].sprite = abilities[slot].DarkMask; abilities[slot].SetLinks(cooldownTextDisplay[slot]); }
public AbilityBaseTriggerable SetDefaultValues(AbilityBaseTriggerable ability) { switch (ability) { case ForceFieldTriggerable ff: Debug.Log(FFBase.name + ", " + FFBase.Damage + ", " + FFBase.TimeToLive); ff.OverloadInitialize(FFBase.Name, FFBase.Damage, FFBase.TimeToLive, FFBase.aBaseCooldown, FFBase.aSprite, FFBase.UpForce, FFBase.Radius, FFBase.HitForce, FFBase.Prefab); return(ff); case LaserTriggerable lt: Debug.Log(LaserBase.name + ", " + LaserBase.Damage + ", " + LaserBase.TimeToLive); lt.OverloadInitialize(LaserBase.name, LaserBase.Damage, LaserBase.TimeToLive, LaserBase.aBaseCooldown, LaserBase.aSprite, LaserBase.HitForce, LaserBase.Color, LaserBase.Prefab, LaserBase.HitMask); return(lt); default: Debug.Log("ability of type " + ability.GetType() + " did not match switch statement in AbilityDataSingleton.cs"); return(null); } }
private void Start() { switch (ability) { case abilitiesEnum.ForceFieldTriggerable: abilityTriggerable = new ForceFieldTriggerable(); Debug.Log(abilityTriggerable.ToString() + ", " + AbilityDataSingleton.Instance.ToString()); abilityTriggerable = (ForceFieldTriggerable)AbilityDataSingleton.Instance.SetDefaultValues(abilityTriggerable); break; case abilitiesEnum.LaserTriggerable: abilityTriggerable = new LaserTriggerable(); abilityTriggerable = (LaserTriggerable)AbilityDataSingleton.Instance.SetDefaultValues(abilityTriggerable); break; default: break; } AbilityNameText.text = abilityTriggerable.Name; //abilityTriggerable = (Type.GetType(ability.ToString()))Activator.CreateInstance(Type.GetType(ability.ToString())); //abilityTriggerable = (AbilityBaseTriggerable)AbilityDataSingleton.Instance.SetDefaultValues(abilityTriggerable); }
public virtual void SetDefaultValues(AbilityBaseTriggerable ability) => ability.Initialize(Name, Damage, TimeToLive, aBaseCooldown, aSprite);
public override void SetDefaultValues(AbilityBaseTriggerable ability) { (ability as ForceFieldTriggerable).OverloadInitialize(Name, Damage, TimeToLive, aBaseCooldown, aSprite, UpForce, Radius, HitForce, Prefab); }
public override void SetDefaultValues(AbilityBaseTriggerable ability) { (ability as LaserTriggerable).OverloadInitialize(Name, Damage, TimeToLive, aBaseCooldown, aSprite, HitForce, Color, Prefab, HitMask); }