mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 20:38:56 -05:00
Add JsonUtilityTest
This commit is contained in:
@@ -667,5 +667,31 @@ namespace UniGLTF
|
||||
GameObject.DestroyImmediate(go);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
class CantConstruct
|
||||
{
|
||||
public bool Value = true;
|
||||
|
||||
public CantConstruct(bool value)
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
class Dummy
|
||||
{
|
||||
public CantConstruct Value;
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void JsonUtilityTest()
|
||||
{
|
||||
var dummy = JsonUtility.FromJson<Dummy>("{}");
|
||||
Assert.NotNull(dummy.Value);
|
||||
Assert.False(dummy.Value.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user