예제 #1
3
UStaticMeshComponent* UACarryObjectComponent::GetCarriedMeshComponent()
{
	USceneComponent* ChildComp = GetChildComponent(0);
	if (ChildComp)
	{
		AActor* OwningActor = ChildComp->GetOwner();
		if (OwningActor)
		{
			return Cast<UStaticMeshComponent>(OwningActor->GetComponentByClass(UStaticMeshComponent::StaticClass()));
		}
	}
	return nullptr;
}
예제 #2
0
AActor* UACarryObjectComponent::GetCarriedActor()
{
	USceneComponent* ChildComp = GetChildComponent(0);
	if (ChildComp)
	{
		return ChildComp->GetOwner();
	}
	return nullptr;
}
bool USCarryObjectComponent::GetIsCarryingActor()
{
	return GetChildComponent(0) != nullptr;
}