Ejemplo n.º 1
0
    void Serialize()
    {
        var scene = SceneManager.GetActiveScene();
        var data  = SceneSerializer.Serialize(scene);

        SceneSerializer.DeserializeGameObjects(data, transform);
    }
Ejemplo n.º 2
0
        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);
            }
        }