本文整理汇总了C++中UNavigationSystem::GetMainNavData方法的典型用法代码示例。如果您正苦于以下问题:C++ UNavigationSystem::GetMainNavData方法的具体用法?C++ UNavigationSystem::GetMainNavData怎么用?C++ UNavigationSystem::GetMainNavData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UNavigationSystem
的用法示例。
在下文中一共展示了UNavigationSystem::GetMainNavData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ServerCollectNavmeshData_Validate
bool UGameplayDebuggingComponent::ServerCollectNavmeshData_Validate(FVector_NetQuantize10 TargetLocation)
{
bool bIsValid = false;
#if WITH_RECAST
UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(GetWorld());
bIsValid = NavSys && NavSys->GetMainNavData(FNavigationSystem::DontCreate);
#endif
return bIsValid;
}
示例2: GetNavData
ARecastNavMesh* UGameplayDebuggingComponent::GetNavData()
{
UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(GetWorld());
if (NavSys == NULL)
{
return NULL;
}
// Try to get the correct nav-mesh relative to the selected actor.
APawn* TargetPawn = Cast<APawn>(TargetActor);
if (TargetPawn != NULL)
{
const FNavAgentProperties* NavAgentProperties = TargetPawn->GetNavAgentProperties();
if (NavAgentProperties != NULL)
{
return Cast<ARecastNavMesh>(NavSys->GetNavDataForProps(*NavAgentProperties));
}
}
// If it wasn't found, just get the main nav-mesh data.
return Cast<ARecastNavMesh>(NavSys->GetMainNavData(FNavigationSystem::DontCreate));
}