Database schema
Here is the database schema, we use for that example.
-
Scene
- is linked to Unity scene, it's name should be equal to Unity scene name. It has the following fields:spawnPosition [Vector3]
- position, the player will be moved then he's spawned in this scenespawnRotation [Vector3]
- rotation, the player will be rotated then he's spawned in this scenebounds [Bounds]
- area for spawning objects
-
Collectable
- is Scene's nested field, meaning it defines its own table (meta), which is connected toScene
table (meta). It stores all collectable objects in the scene and have the following fields:position [Vector3]
- position of the objectgold [int]
- amount of gold, attached to the objecttype [relationSingle]
- type of the object
-
CollectableType
- type of theCollectable
prefab [unityPrefab]
- prefab to use as an object to spawnaudio [audioClip]
- sound to play then object is collected
-
Player
- single entity table (meta), which store info about playergold [int]
- amount of gold player gatheredposition [Vector3]
- player's position, used by SaveLoad addon to save and load player's positionrotation [Quaternion]
- player's rotation, used by SaveLoad addon to save and load player's positionscene [string]
- player's scene, used by SaveLoad addon to save and load player's position