Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
GameManager.h
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "PixoVRCharacter.h"
10#include "Story/StoryScript.h"
11#include "GameManager.generated.h"
12
13DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWrongInteractableActorGrabbed, AActor*, WrongInteractableActor);
14DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnNewInteractableItemAdded, ABaseStoryActor*, NewInteractableItem);
15
19UCLASS(Blueprintable)
20class PIXOCORE_API UGameManager : public UBaseManager
21{
24public:
25 // Manager event declaration
30public:
32
37 UFUNCTION(BlueprintImplementableEvent, Category = "GameManager")
38 void OnNewStepLoaded(const FText& StepName);
39
44 UFUNCTION(BlueprintImplementableEvent, Category = "GameManager")
45 void OnNewStoryLoaded(const FText& StepName);
46
51 UFUNCTION(BlueprintNativeEvent, Category = "GameManager")
52 void OnGrabbingWrongActor(AActor* WrongActor);
53
59 UFUNCTION(BlueprintNativeEvent, Category = "GameManager")
60 void OnTeleportActivatedRaw(EControllerHand Hand, bool InActivate);
61
65 UFUNCTION(BlueprintNativeEvent, Category = "GameManager")
66 void OnInitialization();
67
71 UFUNCTION(BlueprintImplementableEvent, Category = "GameManager")
72 void OnInteractiveItemAdded(ABaseStoryActor* AddedInteractiveItem);
73
74 UFUNCTION(BlueprintCallable, Category = "GameManager|InteractiveItems")
75 void AddNewInteractableObject(ABaseStoryActor* InteractableActor);
76
77 UFUNCTION(BlueprintCallable, Category = "GameManager|DynamicStory")
78 void NewDynamicStoryAdded(FDynamicStoryData DynamicStoryData);
79
80 UFUNCTION(BlueprintCallable, Category = "GameManager|InteractiveItems")
81 void PopulateInteractiveObjectsWithStepData(ABaseStoryActor* TargetActor);
82
83 UFUNCTION()
84 void OnEndStoryReached();
85
86 UFUNCTION(BlueprintCallable, Category = "GameManager|Data")
87 TArray<ABaseStoryActor*> GetInteractiveItemsArray() {return InteractiveItemsArray;}
88
89 UFUNCTION(BlueprintCallable, Category = "GameManager|Functionality")
90 void GetAllActorsOfClass(TSubclassOf<AActor> TargetClass, TArray<AActor*>& OutActors);
91
92 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
93 FText CurrentStep;
94
95 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
96 USoundManager* SoundManagerRef;
97
98 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
99 UStoryManager* StoryManagerRef;
100
101 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
102 APixoVRCharacter* PlayerPawnRef;
103
104 UPROPERTY(BlueprintReadWrite, Category = "GameManager")
105 AGameModeBase* GameModeBaseRef;
106
107 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GameManager|Script")
108 UStoryScriptClassData* StoryScriptClassData;
110
111 UPROPERTY(EditDefaultsOnly, Category = "GameManager|Script")
112 bool IsUsingStoryScriptData = false;
113
114 UPROPERTY(BlueprintReadOnly, Category = "GamaManager|Script")
115 TArray<FScriptInstanceData> ScriptInstancesData;
116
117 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GameManager|WrongActionFeedback")
118 bool bWrongInteractableActorGrabEnabled = false;
119
120 UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)
121 FOnWrongInteractableActorGrabbed OnWrongInteractableActorGrabbed;
123 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GameManager|DynamicStory")
124 bool IsUsingDynamicStory{false};
125
126 UPROPERTY(BlueprintAssignable, Category = "GameManager|Delegates")
127 FOnNewInteractableItemAdded OnNewInteractableItemAdded;
128
129protected:
130
131 UFUNCTION()
132 void SpawnStoryScripts();
133
134 UFUNCTION()
135 void InitializeNewDynamicStory(FDynamicStoryData DynamicStoryData);
136
137 UPROPERTY()
138 TArray<FDynamicStoryData> DynamicStoryQueue;
139
140 UPROPERTY()
141 int ActiveDynamicStoryIndex = -1;
142
143 UPROPERTY()
144 TArray<UStoryScriptClassData*> DynamicStoryScripts;
145
146 UPROPERTY(BlueprintReadOnly, Category = "GameManager|InteractiveItems")
147 TArray<ABaseStoryActor*> InteractiveItemsArray;
148
149 UPROPERTY()
150 TArray<UInteractiveObjectDataBase*> InteractiveObjectStepDataBase;
151};
#define DECLARE_EVENT_HANDLER(TEvent)
Definition BaseManager.h:11
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWrongInteractableActorGrabbed, AActor *, WrongInteractableActor)
Base class for story actors.
Pixo VR Character This class represents the main character in the Pixo VR game. It extends the AVRCha...
It provides functionalities for handling events, sending events, and managing a private owner....
Definition BaseManager.h:32
Manager for managing player experience, accepts various events such as player teleportation,...
Definition GameManager.h:24
FText CurrentStep
UPROPERTY(BlueprintReadWrite, Category = "GameManager")
FOnNewInteractableItemAdded OnNewInteractableItemAdded
UPROPERTY(BlueprintAssignable, Category = "GameManager|Delegates")
DECLARE_EVENT_HANDLER(UNewStepLoadedEvent)
void OnInitialization()
Function for overriding. Called when initialization ended.
TArray< ABaseStoryActor * > GetInteractiveItemsArray()
UFUNCTION(BlueprintCallable, Category = "GameManager|Data")
void OnTeleportActivatedRaw(EControllerHand Hand, bool InActivate)
Function for overriding. Called when teleportation is activated.
FOnWrongInteractableActorGrabbed OnWrongInteractableActorGrabbed
UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)
TArray< UStoryScriptClassData * > DynamicStoryScripts
UPROPERTY()
DECLARE_EVENT_HANDLER(UInitializationEvent)
DECLARE_EVENT_HANDLER(UNewStoryLoadedEvent)
void OnInteractiveItemAdded(ABaseStoryActor *AddedInteractiveItem)
Function for overriding. Called when the interactive item is added to InteractiveItemsArray.
AGameModeBase * GameModeBaseRef
UPROPERTY(BlueprintReadWrite, Category = "GameManager")
void OnNewStepLoaded(const FText &StepName)
Function for overriding. Called when a new step is loaded.
TArray< UInteractiveObjectDataBase * > InteractiveObjectStepDataBase
UPROPERTY()
TArray< FDynamicStoryData > DynamicStoryQueue
UPROPERTY()
TArray< FScriptInstanceData > ScriptInstancesData
UPROPERTY(BlueprintReadOnly, Category = "GamaManager|Script")
APixoVRCharacter * PlayerPawnRef
UPROPERTY(BlueprintReadWrite, Category = "GameManager")
UStoryManager * StoryManagerRef
UPROPERTY(BlueprintReadWrite, Category = "GameManager")
TArray< ABaseStoryActor * > InteractiveItemsArray
UPROPERTY(BlueprintReadOnly, Category = "GameManager|InteractiveItems")
UStoryScriptClassData * StoryScriptClassData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GameManager|Script")
USoundManager * SoundManagerRef
UPROPERTY(BlueprintReadWrite, Category = "GameManager")
void OnNewStoryLoaded(const FText &StepName)
Function for overriding. Called when a new story is loaded.
void OnGrabbingWrongActor(AActor *WrongActor)
Function for overriding. Called when the wrong interactable actor is grabbed.
Event called when we on init experience.
Event called when new step is loaded.
Event called when new story is loaded.
Manager that provides functionality for managing VOs and Hint VOs. To use this class you must attach ...
Manager that provides handling story-related operations and data.
Data asset class for storing story script class data.
Definition StoryScript.h:83
USTRUCT(BlueprintType)
Struct for holding script instance data.
Definition StoryScript.h:47