Пример #1
0
 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]);
 }
Пример #2
0
    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);
        }
    }
Пример #3
0
    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);
    }
Пример #4
0
 public virtual void SetDefaultValues(AbilityBaseTriggerable ability) => ability.Initialize(Name, Damage, TimeToLive, aBaseCooldown, aSprite);
Пример #5
0
 public override void SetDefaultValues(AbilityBaseTriggerable ability)
 {
     (ability as ForceFieldTriggerable).OverloadInitialize(Name, Damage, TimeToLive, aBaseCooldown, aSprite, UpForce, Radius, HitForce, Prefab);
 }
Пример #6
0
 public override void SetDefaultValues(AbilityBaseTriggerable ability)
 {
     (ability as LaserTriggerable).OverloadInitialize(Name, Damage, TimeToLive, aBaseCooldown, aSprite, HitForce, Color, Prefab, HitMask);
 }