UAnimInstance
https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Animation/UAnimInstance/index.html
AnimInstance是Animation Blueprint的C++版本。
角色蓝图中,设置动画蓝图是设置的Anim Class属性:
这个设置的步骤如果用C++操作,如下设置:
USkeletalMeshComponent::SetAnimInstanceClass(UClass* NewClass);
具体实例:
UAnimBlueprintGeneratedClass* MeshAnim = LoadObject<UAnimBlueprintGeneratedClass>(NULL, TEXT("/Game/Character/HeroTPP_AnimBlueprint.HeroTPP_AnimBlueprint"));
Mesh->SetAnimInstanceClass(MeshAnim);
如果想用C++ UAnimInstance代替蓝图动画,那么需要创建一个自己的UAnimInstance,并在其中实现自己的动画逻辑,UAnimInstance里面的具体函数还不熟悉,先标记下,等项目后期再将动画蓝图改为C++。
Game Instance, Custom Game Instance For Inter-Level Persistent Data Storage