I have an EMPTY. as a child I have an object with the script I need to save.
I have get/set for protected variables.
(example)
Code: Select all
[SerializeField] [Range(0, 1)] protected float _bodyArmour
Code: Select all
public float bodyArmour
{
get { return _bodyArmour; }
set { _bodyArmour = value; }
}
I even tried adding [ES3Serializable] before the public float.
It only saves the default value, never the changed value. If it starts at 0, and I change it to 15, it saves as 0.
I use a list for the game object NPCs. Drag the NPC parent object into that list in the inspector.
Code: Select all
public List<GameObject> enemies = new List<GameObject>();
I then even went into types, properties and selected the values I wanted saved. Still only saves the default value.
Code: Select all
ES3.Save("Enemies", enemies);