Loading of raw UnityEngine.Object not working
Posted: Thu Jan 19, 2023 8:32 pm
Seems like variables whose type is UnityEngine.Object (saved by ref) are not deserialized correctly?
Subclasses of UnityEngine.Object work correctly but not the class itself.
Minimal example:
Looking at the save file, the field is saved correctly (as an ESRef id), but when loading the field is set to null.
Replacing UnityEngine.Object with e.g. Component works fine. This is an OK workaround for my situation since the objects I want to save are all Components, but it does seem like a bug as far as I can tell.
For context, I am trying to save a List<UnityEngine.Object> that represents arguments to a function call (ie, Action) which can be serialized/deserialized via ES3 and then invoked after loading.
Subclasses of UnityEngine.Object work correctly but not the class itself.
Minimal example:
Code: Select all
public class SavedComponentTest : MonoBehaviour
{
public UnityEngine.Object xx;
}
Replacing UnityEngine.Object with e.g. Component works fine. This is an OK workaround for my situation since the objects I want to save are all Components, but it does seem like a bug as far as I can tell.
For context, I am trying to save a List<UnityEngine.Object> that represents arguments to a function call (ie, Action) which can be serialized/deserialized via ES3 and then invoked after loading.