コード例 #1
0
    public virtual void Initialize(Entity source, SpecialAbilityData abilitydata, List <SpecialAbilityData> sequencedAbilities = null)
    {
        this.source      = source;
        this.abilitydata = abilitydata;
        SessionID        = IDFactory.GenerateAbilityID();
        SetUpAbility();

        if (sequencedAbilities != null && sequencedAbilities.Count > 0)
        {
            for (int i = 0; i < sequencedAbilities.Count; i++)
            {
                SpecialAbility sAbility = new SpecialAbility();
                this.sequencedAbilities.Add(sAbility);
                sAbility.ParentAbility = this;
                sAbility.Initialize(source, sequencedAbilities[i]);
                //Debug.Log(sequencedAbilities[i].abilityName + " is a sequence of " + abilitydata.abilityName);
            }

            sequenceTimer = new Timer(sequenceWindow, false, ResetSequenceIndex);
        }

        animationHash = Animator.StringToHash(animationTrigger);

        if (activationMethod == Constants.SpecialAbilityActivationMethod.Passive)
        {
            Activate();
        }
    }
コード例 #2
0
ファイル: Ability.cs プロジェクト: Alarack/SARPG
    public Ability(AbilityData data, GameObject source)
    {
        abilityData     = data;
        AbilityID       = IDFactory.GenerateAbilityID();
        Source          = source;
        EffectManager   = new EffectManager(this);
        RecoveryManager = new AbilityRecoveryManager(this);

        useTimer = new Timer("Use Timer", UseDuration, true, PopUseTimer);
        SetUpAbilityData();
    }
コード例 #3
0
    public Ability(AbilityData data, GameObject source, List <AbilityData> sequenceData = null, Ability parent = null)
    {
        abilityData     = data;
        AbilityID       = IDFactory.GenerateAbilityID();
        Source          = source;
        EffectManager   = new EffectManager(this);
        RecoveryManager = new AbilityRecoveryManager(this);
        ParentAbility   = parent;


        SetUpAbilityData();
        SetupAbilitySequences(sequenceData);


        useTimer = new Timer(UseDuration, PopUseTimer, true, "Use");

        GameManager.RegisterAbility(this);
    }