获得拥有者Actor,返回的是拥有这个动画实例的Actor。
//AnimInstance.h
/** Returns the owning actor of this AnimInstance */
UFUNCTION(BlueprintCallable, Category = "Animation", meta=(NotBlueprintThreadSafe))
AActor* GetOwningActor() const;
AActor* UAnimInstance::GetOwningActor() const
{
USkeletalMeshComponent* OwnerComponent = GetSkelMeshComponent();
return OwnerComponent->GetOwner();
}
本文介绍了如何通过动画实例(AnimInstance)获取其所属的Actor。具体实现方式为首先调用GetSkelMeshComponent()获得骨架网格组件,再通过该组件的GetOwner()方法返回拥有此动画实例的Actor。
1390

被折叠的 条评论
为什么被折叠?



