void Serialize() { var scene = SceneManager.GetActiveScene(); var data = SceneSerializer.Serialize(scene); SceneSerializer.DeserializeGameObjects(data, transform); }
public static void OpenFile() { var path = EditorUtility.OpenFilePanel("Open a serialized scene file", "", "bin"); if (path.Length != 0) { var data = File.ReadAllBytes(path); var parent = new GameObject(Path.GetFileName(path)); SceneSerializer.DeserializeGameObjects(data, parent.transform); } }