Hi Eric,
Thanks for sending that over. I'm getting the following warning, so you might want to check that your error console is configured correctly:
Reference for UnityEngine.Material with ID 5165723412715100437 could not be found in Easy Save's reference manager
This happens because when you access a MeshRenderer's 'material' field to change it's colour, it creates a new instance of that Material. This Material instance will no longer exist when you exit the scene or exit play mode.
In this case you would either need to use the 'sharedMaterial' field, or you would need to save and load the colour separately. E.g.
Code: Select all
public class SaveManager : MonoBehaviour
{
public void SaveCube(GameObject cube) {
ES3.Save("material", cube.GetComponent<MeshRenderer>().material.color);
ES3.Save("cube", cube);
}
public void LoadCube(GameObject cube) {
ES3.LoadInto("cube", cube);
cube.GetComponent<MeshRenderer>().material.color = ES3.Load<Color>("material");
}
}
I also recommend deleting your save data after making any changes by going to Tools > Easy Save 3 > Clear Persistent Data Path.
All the best,
Joel