Skip to content
Snippets Groups Projects
Commit f37eabd4 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Merge branch 'refactor/cave_overlay' into 'dev/5.3'

refactor(cave): Adjust Cave Overlay to new VirtualRealityPawn, Livelink and inputs

See merge request vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit!44
parents 525d88a6 c6435f06
No related branches found
No related tags found
1 merge request!44refactor(cave): Adjust Cave Overlay to new VirtualRealityPawn, Livelink and inputs
Showing
with 178 additions and 216 deletions
No preview for this file type
File deleted
File deleted
File deleted
File deleted
File deleted
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
No preview for this file type
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "CAVEOverlay/CAVEOverlay.h"
void FCAVEOverlay::Register()
{
On_Post_World_Initialization_Delegate.BindRaw(this, &FCAVEOverlay::OnSessionStart);
SessionStartDelegate = FWorldDelegates::OnPostWorldInitialization.Add(On_Post_World_Initialization_Delegate);
}
void FCAVEOverlay::Unregister() const
{
FWorldDelegates::OnPostWorldInitialization.Remove(SessionStartDelegate);
}
void FCAVEOverlay::OnSessionStart(UWorld* World, const UWorld::InitializationValues)
{
if (!World->IsGameWorld())
return;
const UCAVEOverlaySettings* Settings = GetDefault<UCAVEOverlaySettings>();
/* Test if we already spawned a CAVEOverlayController */
TArray<AActor*> Actors;
UGameplayStatics::GetAllActorsOfClass(World, ACAVEOverlayController::StaticClass(), Actors);
if ((Settings->DefaultActivationType == DefaultActivationType_ON
!= Settings->ExcludedMaps.ContainsByPredicate(
[World](const FSoftObjectPath& Map) { return Map.GetAssetName() == World->GetName(); }
)) && Actors.Num() == 0)
{
World->SpawnActor(ACAVEOverlayController::StaticClass());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment