Each scene has a GameLogicManager prefab for core game logic to function properly, as well as other functionalities such as Developer Mode. (Think of the mode as basically cheats designed to make your life easier with design and testing.)
Part of the GameLogicManager prefab, and is an extremely useful tool we built to test out things and bypass limitations when working in Unity. You can access the DeveloperMode UI by pressing the ` key on your keyboard. (Above Tab in QUERTY keyboards)
The core component handling and enabling object hovering and interaction in the game. To create an interactable object based on the current interaction system, ensure your object has a non-trigger collider, is layered as Interactable, and then create and place a script on it that inherits from InteractableObject. The script should also implement interaction events and methods as follows:
Part of the level design pipeline will be to make each room in a separate scene and load those scenes additively so that they are “on top” of each other, so to speak (But since each will have different world coordinates there should be no clipping). The Scene Loader prefab has a singleton script that has functions to help ensure that scenes are loaded correctly and reloaded when a puzzle in one of them needs to be reset.
When the player switches rooms, call LoadAndActivateScene() passing in the build index of the new room they're in in order to make the new room the Active scene. When the player dies in a puzzle room, the active scene is reloaded, thus resetting all objects in it to their original states.
The checkpoint system consists of three prefabs:
Death Manager - Consists of a script that keeps track of the kill zones and checkpoints in a level. Should be the parent of all Kill Zones and Checkpoints in a system. Each scene/room should have its own Death Manager in order to ensure that the player respawns at the intended recent checkpoint. Can have multiple death managers in a room but I don’t recommend it for simplicity’s sake.
Kill Zone Prefab - Consists of an invisible trigger box collider that kills the player as soon as they enter it and teleports them to their most recent checkpoint that is kept track of by its Death Manager. It also has a boolean that can be set to restart the current scene if necessary. Can be placed anywhere and can be any size but should be the child object of its Death Manager in order to work correctly.
Checkpoint Prefab - Consists of an invisible trigger box collider that saves the location of the player and sets it as the most recent checkpoint for its Death Manager parent. Can be placed anywhere and can be any size but should be the child object of its Death Manager in order to work correctly. Each checkpoint has a boolean that, if checked, will make it the initial spawn point of a death manager system so that the player can respawn even if they haven't reached any other checkpoints.