public override void ActivateAbility(AbilitySystemComponent AbilitySystem, GameplayAbility Ability) { //ActivateAbility(AbilitySystem, new GameplayEventData()); Ability.EndAbility(AbilitySystem); }
public abstract void ActivateAbility(AbilitySystemComponent AbilitySystem, GameplayAbility Ability);
public override async void ActivateAbility(AbilitySystemComponent AbilitySystem, GameplayAbility Ability) { var abilitySystemActor = AbilitySystem.GetActor(); var animationEventSystemComponent = abilitySystemActor.GetComponent <AnimationEventSystem>(); var animatorComponent = abilitySystemActor.GetComponent <Animator>(); // Make sure we have enough resources. End ability if we don't (_, var gameplayEventData) = await AbilitySystem.OnGameplayEvent.WaitForEvent((gameplayTag, eventData) => gameplayTag == WaitForEventTag); animatorComponent.SetTrigger(AnimationTriggerName); animatorComponent.SetTrigger(AnimationCompleteTriggerName); if (ExecuteEffectEvent != null) { await animationEventSystemComponent.CustomAnimationEvent.WaitForEvent((x) => x == ExecuteEffectEvent); } _ = AbilitySystem.ApplyGameEffectToTarget(TargetGameplayEffect, gameplayEventData.Target); var beh = animatorComponent.GetBehaviour <AnimationBehaviourEventSystem>(); await beh.StateEnter.WaitForEvent((animator, stateInfo, layerIndex) => stateInfo.fullPathHash == Animator.StringToHash(CompletionAnimatorStateFullHash)); // End Ability Ability.EndAbility(AbilitySystem); }