Downloads

← Back Basic 3D example (database schema)

Database schema

Here is the database schema, we use for that example.

  1. Scene- is linked to Unity scene, it's name should be equal to Unity scene name. It has the following fields:
    1. spawnPosition [Vector3]- position, the player will be moved then he's spawned in this scene
    2. spawnRotation [Vector3]- rotation, the player will be rotated then he's spawned in this scene
    3. bounds [Bounds]- area for spawning objects
  2. Collectable - is Scene's nested field, meaning it defines its own table (meta), which is connected to Scene table (meta). It stores all collectable objects in the scene and have the following fields:
    1. position [Vector3]- position of the object
    2. gold [int]- amount of gold, attached to the object
    3. type [relationSingle]- type of the object
  3. CollectableType - type of the Collectable
    1. prefab [unityPrefab]- prefab to use as an object to spawn
    2. audio [audioClip]- sound to play then object is collected
  4. Player - single entity table (meta), which store info about player
    1. gold [int]- amount of gold player gathered
    2. position [Vector3]- player's position, used by SaveLoad addon to save and load player's position
    3. rotation [Quaternion]- player's rotation, used by SaveLoad addon to save and load player's position
    4. scene [string]- player's scene, used by SaveLoad addon to save and load player's position
← Back to Downloads