| UGameplayCueTranslator::GameplayCueToTranslationIndex()
|
Module |
|
Header |
/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayCueTranslator.h |
Include |
#include "GameplayCueTranslator.h" |
virtual int32 GameplayCueToTranslationIndex
(
const FName & TagName,
AActor * TargetActor,
const FGameplayCueParameters & Parameters
) const
This is called at runtime to actually do the swapping. This is a trivial example, we will use hardcoded memory addressess to switch on the 3 possible translations. A more realistic approach would be to look at something on the AActor (maybe, cast it to your base actor or interface type) or the GameplayCue parameters. Using an acceleration map may be a good idea here: your translator class could have access to a global map that maps actor* -> swap index.
Important thing to understand: the int32 returned is the index into the SwapList that we created in ::GetTranslationNameSpawns()!