Data - CodingDino/Dino-Unity-Toolkit GitHub Wiki

An Data component is a type of component from the Dino Unity Toolkit. Data components store information to activate or be used by actions. This data can also be saved and loaded, between scenes or even to the hard disk between play sessions.

Data components act as both Actions and Activators. When the values change or reach set minimum or maximum values, they act as Activators, informing any linked Actions of the change. Alternatively, other scripts can activate Action functions on the Data components to set or add to the data.

For example, the TimerAction keeps track of its current time using a FloatData script. While the timer is running, the TimerAction updates the value of the FloatData each frame. The FloatData uses Activator behaviour to update the display text using a UITextAction, while restarting itself using its own Action, ActionResetValue().

Image: A FloatData set up to work with a TimerAction and a SpawnObjectAction to spawn copies of the player every 20 seconds. This is displayed to the player using a UITextAction

Image: The FloatData from above in action.