#include "BaseAnimInstance.h"
#include "Animation/AnimNodeBase.h"
#include "Animation/AnimInstanceProxy.h"
#include "Animation/AnimNode_StateMachine.h"
FName UBaseAnimInstance::GetCurState(FName animMachineName)
{
FAnimInstanceProxy &proxy = GetProxyOnAnyThread<FAnimInstanceProxy>();
FAnimNode_StateMachine *pStateMachine = proxy.GetStateMachineInstanceFromName(animMachineName);
if (pStateMachine) {
return pStateMachine->GetCurrentStateName();
}
else {
return FName();
}
// 获取动画状态机当前状态id
int32 curStateID = pStateMachine->GetCurrentState();
// 获取状态机id
int32 curAnimMachine = proxy.GetStateMachineIndex(animMachineName)
}
网友评论