Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
UGameManager Class ReferenceBlueprintable

Manager for managing player experience, accepts various events such as player teleportation, and can be expanded with properties that allow access to actors on the level. More...

#include <GameManager.h>

Inheritance diagram for UGameManager:
[legend]

Public Member Functions

 UGameManager ()
 
void AddNewInteractableObject (ABaseStoryActor *InteractableActor)
 UFUNCTION(BlueprintCallable, Category = "GameManager|InteractiveItems")
 
 DECLARE_EVENT_HANDLER (UInitializationEvent)
 
 DECLARE_EVENT_HANDLER (UNewStepLoadedEvent)
 
 DECLARE_EVENT_HANDLER (UNewStoryLoadedEvent)
 
void GetAllActorsOfClass (TSubclassOf< AActor > TargetClass, TArray< AActor * > &OutActors)
 UFUNCTION(BlueprintCallable, Category = "GameManager|Functionality")
 
TArray< ABaseStoryActor * > GetInteractiveItemsArray ()
 UFUNCTION(BlueprintCallable, Category = "GameManager|Data")
 
APlayerController * GetPrivateOwner () const
 
void HandleEvent (UBaseEvent *Event)
 
void NewDynamicStoryAdded (FDynamicStoryData DynamicStoryData)
 UFUNCTION(BlueprintCallable, Category = "GameManager|DynamicStory")
 
void OnEndStoryReached ()
 UFUNCTION()
 
void OnGrabbingWrongActor (AActor *WrongActor)
 Function for overriding. Called when the wrong interactable actor is grabbed.
 
void OnInitialization ()
 Function for overriding. Called when initialization ended.
 
void OnInteractiveItemAdded (ABaseStoryActor *AddedInteractiveItem)
 Function for overriding. Called when the interactive item is added to InteractiveItemsArray.
 
void OnNewStepLoaded (const FText &StepName)
 Function for overriding. Called when a new step is loaded.
 
void OnNewStoryLoaded (const FText &StepName)
 Function for overriding. Called when a new story is loaded.
 
void OnTeleportActivatedRaw (EControllerHand Hand, bool InActivate)
 Function for overriding. Called when teleportation is activated.
 
void PopulateInteractiveObjectsWithStepData (ABaseStoryActor *TargetActor)
 UFUNCTION(BlueprintCallable, Category = "GameManager|InteractiveItems")
 
template<typename TEventType , typename... TInitializeArgs>
void SendEvent (TInitializeArgs... Arguments)
 
void SetPrivateOwner (APlayerController *Owner)
 

Public Attributes

bool bWrongInteractableActorGrabEnabled = false
 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GameManager|WrongActionFeedback")
 
FText CurrentStep
 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
 
AGameModeBaseGameModeBaseRef
 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
 
bool IsUsingDynamicStory {false}
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GameManager|DynamicStory")
 
bool IsUsingStoryScriptData = false
 UPROPERTY(EditDefaultsOnly, Category = "GameManager|Script")
 
FOnNewInteractableItemAdded OnNewInteractableItemAdded
 UPROPERTY(BlueprintAssignable, Category = "GameManager|Delegates")
 
FOnWrongInteractableActorGrabbed OnWrongInteractableActorGrabbed
 UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)
 
APixoVRCharacterPlayerPawnRef
 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
 
TArray< FScriptInstanceDataScriptInstancesData
 UPROPERTY(BlueprintReadOnly, Category = "GamaManager|Script")
 
USoundManagerSoundManagerRef
 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
 
UStoryManagerStoryManagerRef
 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
 
UStoryScriptClassDataStoryScriptClassData
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GameManager|Script")
 

Protected Member Functions

void HandleEvent_Impl (class UBaseEvent *Event)
 
void InitializeNewDynamicStory (FDynamicStoryData DynamicStoryData)
 UFUNCTION()
 
void SpawnStoryScripts ()
 UFUNCTION()
 

Protected Attributes

int ActiveDynamicStoryIndex = -1
 UPROPERTY()
 
TArray< FDynamicStoryDataDynamicStoryQueue
 UPROPERTY()
 
TArray< UStoryScriptClassData * > DynamicStoryScripts
 UPROPERTY()
 
THandlers Handlers
 
TArray< ABaseStoryActor * > InteractiveItemsArray
 UPROPERTY(BlueprintReadOnly, Category = "GameManager|InteractiveItems")
 
TArray< UInteractiveObjectDataBase * > InteractiveObjectStepDataBase
 UPROPERTY()
 

Private Types

using THandler = TFunction<void(UBaseEvent*)>
 
using THandlerKey = UClass*
 
using THandlers = std::unordered_map<THandlerKey, THandler, THandlerHash, THandlerComp>
 

Private Member Functions

 GENERATED_BODY ()
 

Private Attributes

APlayerController * PrivateOwner
 UPROPERTY()
 

Detailed Description

Manager for managing player experience, accepts various events such as player teleportation, and can be expanded with properties that allow access to actors on the level.

UCLASS(Blueprintable)

Definition at line 23 of file GameManager.h.

Member Typedef Documentation

◆ THandler

using UBaseManager::THandler = TFunction<void(UBaseEvent*)>
privateinherited

Definition at line 56 of file BaseManager.h.

◆ THandlerKey

using UBaseManager::THandlerKey = UClass*
privateinherited

Definition at line 55 of file BaseManager.h.

◆ THandlers

using UBaseManager::THandlers = std::unordered_map<THandlerKey, THandler, THandlerHash, THandlerComp>
privateinherited

Definition at line 74 of file BaseManager.h.

Constructor & Destructor Documentation

◆ UGameManager()

UGameManager::UGameManager ( )

Definition at line 13 of file GameManager.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ AddNewInteractableObject()

void UGameManager::AddNewInteractableObject ( ABaseStoryActor * InteractableActor)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "GameManager|InteractiveItems")

Definition at line 22 of file GameManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DECLARE_EVENT_HANDLER() [1/3]

UGameManager::DECLARE_EVENT_HANDLER ( UInitializationEvent )

◆ DECLARE_EVENT_HANDLER() [2/3]

UGameManager::DECLARE_EVENT_HANDLER ( UNewStepLoadedEvent )

◆ DECLARE_EVENT_HANDLER() [3/3]

UGameManager::DECLARE_EVENT_HANDLER ( UNewStoryLoadedEvent )

◆ GENERATED_BODY()

UGameManager::GENERATED_BODY ( )
private

◆ GetAllActorsOfClass()

void UGameManager::GetAllActorsOfClass ( TSubclassOf< AActor > TargetClass,
TArray< AActor * > & OutActors )
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "GameManager|Functionality")

Definition at line 97 of file GameManager.cpp.

◆ GetInteractiveItemsArray()

TArray< ABaseStoryActor * > UGameManager::GetInteractiveItemsArray ( )
inlineBlueprintCallable

UFUNCTION(BlueprintCallable, Category = "GameManager|Data")

Definition at line 122 of file GameManager.h.

◆ GetPrivateOwner()

APlayerController * UBaseManager::GetPrivateOwner ( ) const
inlineinherited

Definition at line 47 of file BaseManager.h.

Here is the caller graph for this function:

◆ HandleEvent()

void UBaseManager::HandleEvent ( UBaseEvent * Event)
inherited

Definition at line 11 of file BaseManager.cpp.

◆ HandleEvent_Impl()

void UBaseManager::HandleEvent_Impl ( class UBaseEvent * Event)
protectedinherited

Definition at line 24 of file BaseManager.cpp.

◆ InitializeNewDynamicStory()

void UGameManager::InitializeNewDynamicStory ( FDynamicStoryData DynamicStoryData)
protected

UFUNCTION()

Definition at line 63 of file GameManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewDynamicStoryAdded()

void UGameManager::NewDynamicStoryAdded ( FDynamicStoryData DynamicStoryData)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "GameManager|DynamicStory")

Definition at line 31 of file GameManager.cpp.

Here is the call graph for this function:

◆ OnEndStoryReached()

void UGameManager::OnEndStoryReached ( )

UFUNCTION()

Definition at line 80 of file GameManager.cpp.

Here is the call graph for this function:

◆ OnGrabbingWrongActor()

void UGameManager::OnGrabbingWrongActor ( AActor * WrongActor)
BlueprintNativeEvent

Function for overriding. Called when the wrong interactable actor is grabbed.

Parameters
WrongActorThe wrong actor.

UFUNCTION(BlueprintNativeEvent, Category = "GameManager")

Here is the caller graph for this function:

◆ OnInitialization()

void UGameManager::OnInitialization ( )
BlueprintNativeEvent

Function for overriding. Called when initialization ended.

UFUNCTION(BlueprintNativeEvent, Category = "GameManager")

◆ OnInteractiveItemAdded()

void UGameManager::OnInteractiveItemAdded ( ABaseStoryActor * AddedInteractiveItem)
BlueprintImplementableEvent

Function for overriding. Called when the interactive item is added to InteractiveItemsArray.

UFUNCTION(BlueprintImplementableEvent, Category = "GameManager")

Here is the caller graph for this function:

◆ OnNewStepLoaded()

void UGameManager::OnNewStepLoaded ( const FText & StepName)
BlueprintImplementableEvent

Function for overriding. Called when a new step is loaded.

Parameters
StepNameThe name of the newly loaded step.

UFUNCTION(BlueprintImplementableEvent, Category = "GameManager")

◆ OnNewStoryLoaded()

void UGameManager::OnNewStoryLoaded ( const FText & StepName)
BlueprintImplementableEvent

Function for overriding. Called when a new story is loaded.

Parameters
StepNameThe name of the first loaded step in this story.

UFUNCTION(BlueprintImplementableEvent, Category = "GameManager")

◆ OnTeleportActivatedRaw()

void UGameManager::OnTeleportActivatedRaw ( EControllerHand Hand,
bool InActivate )
BlueprintNativeEvent

Function for overriding. Called when teleportation is activated.

Parameters
HandHand by which teleport was executed
InActivateIndicates whether the teleportation is being activated (true when showing teleport circle, false when executing teleport).

UFUNCTION(BlueprintNativeEvent, Category = "GameManager")

◆ PopulateInteractiveObjectsWithStepData()

void UGameManager::PopulateInteractiveObjectsWithStepData ( ABaseStoryActor * TargetActor)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "GameManager|InteractiveItems")

Definition at line 109 of file GameManager.cpp.

Here is the caller graph for this function:

◆ SendEvent()

template<typename TEventType , typename... TInitializeArgs>
void UBaseManager::SendEvent ( TInitializeArgs... Arguments)
inlineinherited

Definition at line 40 of file BaseManager.h.

Here is the call graph for this function:

◆ SetPrivateOwner()

void UBaseManager::SetPrivateOwner ( APlayerController * Owner)
inlineinherited

Definition at line 46 of file BaseManager.h.

◆ SpawnStoryScripts()

void UGameManager::SpawnStoryScripts ( )
protected

UFUNCTION()

Definition at line 46 of file GameManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ActiveDynamicStoryIndex

int UGameManager::ActiveDynamicStoryIndex = -1
protected

UPROPERTY()

Definition at line 228 of file GameManager.h.

◆ bWrongInteractableActorGrabEnabled

bool UGameManager::bWrongInteractableActorGrabEnabled = false
BlueprintReadWriteEditAnywhere

UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GameManager|WrongActionFeedback")

Set true if feedback effect should be played when the wrong interactable actor grabbed.

Definition at line 185 of file GameManager.h.

◆ CurrentStep

FText UGameManager::CurrentStep
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "GameManager")

The current step name.

Definition at line 134 of file GameManager.h.

◆ DynamicStoryQueue

TArray<FDynamicStoryData> UGameManager::DynamicStoryQueue
protected

UPROPERTY()

Definition at line 223 of file GameManager.h.

◆ DynamicStoryScripts

TArray<UStoryScriptClassData*> UGameManager::DynamicStoryScripts
protected

UPROPERTY()

Definition at line 233 of file GameManager.h.

◆ GameModeBaseRef

AGameModeBase* UGameManager::GameModeBaseRef
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "GameManager")

Reference to the GameModeBase.

Definition at line 158 of file GameManager.h.

◆ Handlers

THandlers UBaseManager::Handlers
protectedinherited

Definition at line 77 of file BaseManager.h.

◆ InteractiveItemsArray

TArray<ABaseStoryActor*> UGameManager::InteractiveItemsArray
protectedBlueprintReadOnly

UPROPERTY(BlueprintReadOnly, Category = "GameManager|InteractiveItems")

Definition at line 239 of file GameManager.h.

◆ InteractiveObjectStepDataBase

TArray<UInteractiveObjectDataBase*> UGameManager::InteractiveObjectStepDataBase
protected

UPROPERTY()

Definition at line 244 of file GameManager.h.

◆ IsUsingDynamicStory

bool UGameManager::IsUsingDynamicStory {false}
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GameManager|DynamicStory")

Definition at line 200 of file GameManager.h.

◆ IsUsingStoryScriptData

bool UGameManager::IsUsingStoryScriptData = false
EditDefaultsOnly

UPROPERTY(EditDefaultsOnly, Category = "GameManager|Script")

Flag indicating whether the StoryScriptClassData is being used.

Definition at line 172 of file GameManager.h.

◆ OnNewInteractableItemAdded

FOnNewInteractableItemAdded UGameManager::OnNewInteractableItemAdded
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "GameManager|Delegates")

Definition at line 206 of file GameManager.h.

◆ OnWrongInteractableActorGrabbed

FOnWrongInteractableActorGrabbed UGameManager::OnWrongInteractableActorGrabbed
BlueprintReadWriteBlueprintCallableBlueprintAssignable

UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)

Delegate called when the wrong interactable actor is grabbed

Definition at line 193 of file GameManager.h.

◆ PlayerPawnRef

APixoVRCharacter* UGameManager::PlayerPawnRef
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "GameManager")

Reference to the PixoVRCharacter.

Definition at line 152 of file GameManager.h.

◆ PrivateOwner

APlayerController* UBaseManager::PrivateOwner
privateinherited

UPROPERTY()

Definition at line 53 of file BaseManager.h.

◆ ScriptInstancesData

TArray<FScriptInstanceData> UGameManager::ScriptInstancesData
BlueprintReadOnly

UPROPERTY(BlueprintReadOnly, Category = "GamaManager|Script")

Array of script instance data.

Definition at line 178 of file GameManager.h.

◆ SoundManagerRef

USoundManager* UGameManager::SoundManagerRef
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "GameManager")

Reference to the StoryManager/

Definition at line 140 of file GameManager.h.

◆ StoryManagerRef

UStoryManager* UGameManager::StoryManagerRef
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "GameManager")

Reference to the StoryManager.

Definition at line 146 of file GameManager.h.

◆ StoryScriptClassData

UStoryScriptClassData* UGameManager::StoryScriptClassData
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GameManager|Script")

The data asset containing the script class data. Setup this if you are using story scripts

Definition at line 165 of file GameManager.h.


The documentation for this class was generated from the following files: