Custom data type
using Databox;public class CustomDataClass : DataboxType
{
...
}public override void DrawEditor(){}
public override void DrawInitValueEditor(){}
public override void Reset(){}
public override string Equal(DataboxType _changedValue){} [SerializeField]
private int _health;
[SerializeField]
public int InitHealth; // The initial health value
// Public property of health. By using get and set we can add an OnValueChanged callback
public int Health
{
get {return _health;}
set
{
if (value == _health){return;}
_health = value;
if (OnValueChanged != null){OnValueChanged(this);}
}
}Last updated