|
Is possible to be told after serialization occurs for objects, in the Editor? I know that Unity3D serializes some variables (as described in the SerializeField manual page). After importing a script something in my project, clicking play, or going back from play mode, Unity3D recreates all the objects in memory, and reset all serializable fields. That's why when I Debug.Log() a public variable (like int), it says the default value, but when I access it with other script it says the previous stored (serialized) value. What I want to know is when serialization takes place, to sew my variables in the editor to a more proper object. The manual refers to this process of sewing:
Thing is, in the Editor I can't use the Awake function. I've tried OnEnable, OnBecameVisible, Start, Awake and Reset with no help: none of these functions are called after I make a change in the scripts. The constructor is called, but as I mentioned earlier, it contains the constructor values. Any help would be much appreciated.
(comments are locked)
|
|
You might be able to use a twist on lazy initialization: This seems like it should re-create and re-sew the dictionary each time you get a new object.
(comments are locked)
|

Same problem here.