Question by
Lwyx · Mar 01 at 01:27 PM ·
serialization
Reference to serialized class inside the same class
Is this even possible? I am trying to do this:
[System.Serializable]
public class foo
{
public foo instance;
}
Then, when I modify the reference of the class, it is not saved in the variable. At the moment that I hit play, change scene, close unity, etc the value is null. I am making this change inside a custom editor class, in the onSceneGUI method. Then I save the change with PrefabUtility.RecordPrefabInstancePropertyModifications() since is part of a prefab.
Comment