GlobalVariableBase<T>

class GlobalVariableBase<T> : GlobalVariableBase

Base class for GlobalVariables. Each GlobalVariable represents a single global variable stored in an injectable ScriptableObject.

Properties

value : T

The value this GlobalVariable represents.

onChange : SodaEvent<T>

This event is invoked when the value changes.

Methods

void CopyValueFrom(GlobalVariableBase other)

For copying the value from another GlobalVariable via UnityEvent. The passed GlobalVariable has to be of the same type as this one.


GlobalVariableBase

class GlobalVariableBase : ScriptableObject, ISerializationCallbackReceiver

Base class for GlobalVariables. This non-generic base class allows other classes to use GlobalVariables regardless of their generic type, which used for the savestate system.

void LoadValue(ISavestateReader reader, string key)

Loads the value for this GlobalVariable by using the provided ISavesateReader and key. Override this in a GlobalVariable class to allow it to do so.

void SaveValue(ISavestateWriter writer, string key)

Saves the value of this GlobalVariable by using the provided ISavesateWriter and key. Override this in a GlobalVariable class to allow it to do so.