Files
UnrealEngineUWP/Engine/Source/Runtime/NavigationSystem/Private/NavigationInvokerComponent.cpp
Marcus Wassmer cbfcbbb93b Merging //UE4/Dev-Main@4662404 to Dev-Rendering (//UE4/Dev-Rendering)
#rb none
Should be just copyright updates

[CL 4680440 by Marcus Wassmer in Dev-Rendering branch]
2019-01-03 19:16:26 -05:00

47 lines
1010 B
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);
}
}
}