Files
UnrealEngineUWP/Engine/Source/Runtime/NavigationSystem/Private/NavigationInvokerComponent.cpp
mieszko zielinski f71810668e Extended NavigationInvokerComponent's setter/getter functions set #UE4
#rb none

#ROBOMERGE-OWNER: ryan.vance
#ROBOMERGE-AUTHOR: mieszko.zielinski
#ROBOMERGE-SOURCE: CL 5414613 via CL 5414627 via CL 5418809 via CL 5418833
#ROBOMERGE-BOT: DEVVR (Main -> Dev-VR)

[CL 5421466 by mieszko zielinski in Dev-VR branch]
2019-03-15 17:02:28 -04:00

53 lines
1.2 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "NavigationInvokerComponent.h"
#include "NavigationSystem.h"
UNavigationInvokerComponent::UNavigationInvokerComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, TileGenerationRadius(3000)
, TileRemovalRadius(5000)
{
bAutoActivate = true;
}
void UNavigationInvokerComponent::Activate(bool bReset)
{
Super::Activate(bReset);
AActor* Owner = GetOwner();
if (Owner)
{
UNavigationSystemV1::RegisterNavigationInvoker(*Owner, TileGenerationRadius, TileRemovalRadius);
}
}
void UNavigationInvokerComponent::Deactivate()
{
Super::Deactivate();
AActor* Owner = GetOwner();
if (Owner)
{
UNavigationSystemV1::UnregisterNavigationInvoker(*Owner);
}
}
void UNavigationInvokerComponent::RegisterWithNavigationSystem(UNavigationSystemV1& NavSys)
{
if (IsActive())
{
AActor* Owner = GetOwner();
if (Owner)
{
NavSys.RegisterInvoker(*Owner, TileGenerationRadius, TileRemovalRadius);
}
}
}
void UNavigationInvokerComponent::SetGenerationRadii(const float GenerationRadius, const float RemovalRadius)
{
TileGenerationRadius = GenerationRadius;
TileRemovalRadius = RemovalRadius;
}