-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Scene structure of locations
We have recurring elements in all location scenes, divided into categories by empty separator GameObjects.
[TODO: ADD HIERARCHY PIC]
In this category we have some prefabs that act as global managers, who are generally necessary to play the game, and only exist in one copy. Many of these managers are waiting for an event (see Event System) called OnSceneReady to start. This event is fired by the SceneLoader script present in the scene PersistentManagers, once a location is fully loaded.
Editor initialiser
A "hack" script that takes care of initialising the scene and the game when pressing Play from the editor (something that we call "cold startup"), as if the player came through the main menu in a normal gameplay flow. This script is totally useless in the build, and in fact it is stripped from it thanks to being tagged as EditorOnly.
Spawn system
Takes care of spawning the player when the event OnSceneReady is fired. It uses the last path taken in the PathTakenSO
Scriptable Object to determine in which of the many location entrances to spawn the player Prefab (see Scene entrance and exit below).
Camera system Contains the Camera (as in, the actual Camera component) and also the Cinemachine FreeLook Virtual Camera (VCam) that acts as the main gameplay VCam. Since this VCam needs to frame the player Prefab but this is not instantiated at the beginning of the game, the Camera System script listens to an event called PlayerInstantiated which notifies it and also carries information on the Transform to frame.
It also acts as a proxy to propagate shake events, receiving the impulse on the CameraShake event channel coming mainly from combat actions in the State machine of the characters.
Music player
Fires an event on an AudioCueEventChannel to notify the AudioManager script (located in the PersistentManagers scene, which is loaded at the same time at runtime) to play the music associated to the current location.
Unity Open Projects - Open-source games made by Unity + the community
We are looking forward to see what you will create ❤
- the Unity Creator Advocacy team
- Game architecture overview
- Playing the game in Unity
- Creating a new playable scene
- Building the game
The game systems explained, with API examples. For programmers.
- Event system
- State machine
- Input
- Object pooling
- Runtime anchors
- Audio system
- Narrative
- Dialogue system
- Cutscenes system
- Inventory and Cooking
- Combat
- User Interface
How-tos for designers to expand the game's gameplay.
- Adding quests
- Adding items
- Creating dialogues
- Making a cutscene