mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-08 11:59:26 -05:00
Remove VRMTest.cs
This commit is contained in:
@@ -1,75 +0,0 @@
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using UniGLTF;
|
||||
using UnityEngine;
|
||||
using VRM;
|
||||
|
||||
|
||||
public class VRMTest
|
||||
{
|
||||
static GameObject CreateSimpelScene()
|
||||
{
|
||||
var root = new GameObject("gltfRoot").transform;
|
||||
|
||||
var scene = new GameObject("scene0").transform;
|
||||
scene.SetParent(root, false);
|
||||
scene.localPosition = new Vector3(1, 2, 3);
|
||||
|
||||
return root.gameObject;
|
||||
}
|
||||
|
||||
void AssertAreEqual(Transform go, Transform other)
|
||||
{
|
||||
var lt = go.Traverse().GetEnumerator();
|
||||
var rt = go.Traverse().GetEnumerator();
|
||||
|
||||
while (lt.MoveNext())
|
||||
{
|
||||
if (!rt.MoveNext())
|
||||
{
|
||||
throw new Exception("rt shorter");
|
||||
}
|
||||
|
||||
MonoBehaviourComparator.
|
||||
AssertAreEquals(lt.Current.gameObject, rt.Current.gameObject);
|
||||
VRMMonoBehaviourComparator.
|
||||
AssertAreEquals(lt.Current.gameObject, rt.Current.gameObject);
|
||||
}
|
||||
|
||||
if (rt.MoveNext())
|
||||
{
|
||||
throw new Exception("rt longer");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b3bb055ba3c9384ca27fbeb2c696604
|
||||
timeCreated: 1521102909
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user