Exemple #1
0
    public void UniGLTFSimpleSceneTest()
    {
        var go      = CreateSimpelScene();
        var context = new ImporterContext();

        try
        {
            // export
            var gltf = new glTF();
            using (var exporter = new gltfExporter(gltf))
            {
                exporter.Prepare(go);
                exporter.Export();

                // import
                context.ParseJson <glTF>(gltf.ToJson(), new SimpleStorage(new ArraySegment <byte>()));
                Debug.LogFormat("{0}", context.Json);
                gltfImporter.Import <glTF>(context);

                AssertAreEqual(go.transform, context.Root.transform);
            }
        }
        finally
        {
            //Debug.LogFormat("Destory, {0}", go.name);
            GameObject.DestroyImmediate(go);
            context.Destroy(true);
        }
    }