Beispiel #1
0
    protected override void Awake()
    {
        base.Awake();

        OnCastBuffs = new List <BuffApplicator>();
        foreach (BuffConfiguration configuration in Buffs)
        {
            bool onCastBuff = (configuration.BuffCastTime == BuffConfiguration.CastTimeType.OnSkillCast);
            if (onCastBuff)
            {
                BuffApplicator applicator = ScriptableObject.CreateInstance <BuffApplicator>();
                applicator.Initialize(configuration, ParentSkill.AffinityTypes, ParentSkill.SkillOwner);
                OnCastBuffs.Add(applicator);
            }
        }
    }
Beispiel #2
0
    /*
     * Set our Parent(Skill)
     * Get OnCast & OnHit BuffControllers from 'buffs'
     */
    protected override void Awake()
    {
        // Normal "base.Awake()"
        ParentSkill = GameGlobals.AttachCheckComponent <Skill>(this.gameObject);

        OnCastBuffs = new List <BuffApplicator>();
        OnHitBuffs  = new List <BuffApplicator>();
        foreach (BuffConfiguration configuration in Buffs)
        {
            bool           onCastBuff = (configuration.BuffCastTime == BuffConfiguration.CastTimeType.OnSkillCast);
            BuffApplicator applicator = ScriptableObject.CreateInstance <BuffApplicator>();
            applicator.Initialize(configuration, ParentSkill.AffinityTypes, ParentSkill.SkillOwner);
            if (onCastBuff)
            {
                OnCastBuffs.Add(applicator);
            }
            else
            {
                OnHitBuffs.Add(applicator);
            }
        }
        //Do not call base.Awake(), differences are in the loop
    }