This repository has been archived by the owner on Nov 12, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
[U] Game mode
Stanislav Vasilev edited this page Aug 25, 2021
·
9 revisions
The UVK::GameMode
class is entirely owned by a level and contains pointers to a Game State
, Player State
, Pawn
and a `Player Controller
- Generate a game mode using the Build Tool (for this example it's going to be called
GM
) - Include the game mode header into your level's header
- In the constructor call add the following line with the type of your game mode class as a template argument
gameMode = GameMode::makeGameMode<GM>();
- You have a game mode for your level
To use the game mode's events in you level call the void beginAutohandle()
, void tickAutohandle(float deltaTime)
and void endAutohandle()
in their respective functions void beginPlay()
, void tick(float deltaTime)
, void endPlay()
. This will call all of the game mode's events when one of those events is triggered
You can use the standard cast function to cast a pointer to a game mode to it's original type like this
gameMode = GameMode::makeGameMode<GM>();
auto* a = GameMode::cast<GM>(gameMode);
This project is supported by all the people who joined our discord server and became beta testers. If you want to join the discord you can click here
- Home
- Beginner concepts
- Advanced concepts
- Engine developer and contributor resources