- Home /
Serializing object in scene?
For my physics engine, I'm trying to have objects be able to be created in the scene and left in there for run-time. The starting position is stored in integers and they have to be serialized before run-time for determinism.
So far, I've managed to serialize the variables with EditorUtility.SetDirty:
public override void OnInspectorGUI ()
{
target.StartX = (long)transform.position.x;
etc.
EditorUtility.SetDirty (target);
}
Unfortunately, this serializes the variables for all prefabs and clones of the object, even ones that are in the scene before run-time as well. Is there a way to serialize variables individually for objects like how positions are serialized?
Your answer
Follow this Question
Related Questions
How to save sprite color change on custom inspector ? 0 Answers
Serialising ArrayLists 2 Answers
Can I serialize data in an Editor class? 1 Answer
Undo.RecordObject works with GUI.Button but not with GUILayout.Vector3Field 1 Answer
Using a custom editor script with a prefab instance causes my variables to reset on Play 3 Answers