This was a database framework used in the Sixth Sun game project. This is a series of Unity Scriptable Objects that store values in a Scene
and GameObject
agnostic way. This implementation is based on the similar solution presented in the Unite Austin 2017 - Game Architecture With Scriptable Objects talk.
This implementation supports types of data. All of the scriptable objects have Dev Description
field that allows the designer to add a description to help them manage the database.
-
Numerical values are stored as
float
and are returned in code as eitherfloat
orint
, depending on whether the designer chooses thewhole numbers
option in the editor. The scriptable object also supports clamping this variable between a min and max value. -
Strings
-
Curves. Stored as Unity's
AnimationCurve
-
Keyboard Keys. Using Unity's built-in
KeyCode
type, the variable stores and returns keyboard keys. -
Vectors. There are objects to store
Vector2
andVector3
values.
A Database Variable scriptable object can be created in the Asset browser of the Unity project by right-clicking and accessing the appropriate menu in Create -> Game Variables
and then choosing the desired variable type.
This implementation makes use of the following:
- NaughtyAttributes (MIT License)