You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
When initializing a new world, reset navlinks id counter to make sure each map has its own set of unique ids (else, when cooking map by map, ids may change depending on order of cooking). [REVIEW] [at]Yoan.StAmant [at]Mieszko.Zielinski #rb Yoan.StAmant #ROBOMERGE-SOURCE: CL 11116144 via CL 11116146 via CL 11116148 #ROBOMERGE-BOT: (v640-11091645) [CL 11116177 by aris theophanidis in Main branch]
62 lines
2.0 KiB
C++
62 lines
2.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "NavigationSystemModule.h"
|
|
#include "EngineDefines.h"
|
|
#include "AI/NavigationSystemBase.h"
|
|
#include "Templates/SubclassOf.h"
|
|
#include "Engine/World.h"
|
|
#include "NavLinkCustomInterface.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "NavigationSystem"
|
|
|
|
DEFINE_LOG_CATEGORY_STATIC(LogNavSysModule, Log, All);
|
|
|
|
class FNavigationSystemModule : public INavSysModule
|
|
{
|
|
// Begin IModuleInterface
|
|
virtual void StartupModule() override;
|
|
virtual void ShutdownModule() override;
|
|
|
|
//virtual UNavigationSystemBase* CreateNavigationSystemInstance(UWorld& World) override;
|
|
// End IModuleInterface
|
|
|
|
private:
|
|
#if WITH_EDITOR
|
|
static FDelegateHandle OnPreWorldInitializationHandle;
|
|
#endif
|
|
};
|
|
|
|
IMPLEMENT_MODULE(FNavigationSystemModule, NavigationSystem)
|
|
|
|
#if WITH_EDITOR
|
|
FDelegateHandle FNavigationSystemModule::OnPreWorldInitializationHandle;
|
|
#endif
|
|
|
|
void FNavigationSystemModule::StartupModule()
|
|
{
|
|
// mz@todo bind to all the delegates in FNavigationSystem
|
|
#if WITH_EDITOR
|
|
OnPreWorldInitializationHandle = FWorldDelegates::OnPreWorldInitialization.AddStatic(&INavLinkCustomInterface::OnPreWorldInitialization);
|
|
#endif
|
|
}
|
|
|
|
void FNavigationSystemModule::ShutdownModule()
|
|
{
|
|
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
|
|
// we call this function before unloading the module.
|
|
#if WITH_EDITOR
|
|
FWorldDelegates::OnPreWorldInitialization.Remove(OnPreWorldInitializationHandle);
|
|
#endif
|
|
}
|
|
|
|
//UNavigationSystemBase* FNavigationSystemModule::CreateNavigationSystemInstance(UWorld& World)
|
|
//{
|
|
// UE_LOG(LogNavSysModule, Log, TEXT("Creating NavigationSystem for world %s"), *World.GetName());
|
|
//
|
|
// /*TSubclassOf<UNavigationSystemBase> NavSystemClass = LoadClass<UNavigationSystemBase>(NULL, *UNavigationSystemBase::GetNavigationSystemClassName().ToString(), NULL, LOAD_None, NULL);
|
|
// return NewObject<UNavigationSystemBase>(&World, NavSystemClass);*/
|
|
// return nullptr;
|
|
//}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|