Пример #1
0
    public void VRMSimpleSceneTest()
    {
        var go      = CreateSimpelScene();
        var context = new VRMImporterContext();

        try
        {
            // export
            var gltf = VRMExporter.Export(go);

            using (var exporter = new gltfExporter(gltf))
            {
                exporter.Prepare(go);
                exporter.Export();

                // import
                context.ParseJson(gltf.ToJson(), new SimpleStorage());
                //Debug.LogFormat("{0}", context.Json);
                context.Load();
                AssertAreEqual(go.transform, context.Root.transform);
            }
        }
        finally
        {
            //Debug.LogFormat("Destory, {0}", go.name);
            GameObject.DestroyImmediate(go);
            context.Destroy(true);
        }
    }