public void SkinTest()
        {
            var model = new glTFSkin()
            {
                inverseBindMatrices = 0,
                name   = "b",
                joints = new int[] { 1 },
            };

            var json = model.ToJson();

            Assert.AreEqual(@"{""inverseBindMatrices"":0,""joints"":[1],""name"":""b""}", json);
            Debug.Log(json);
        }
        public void SkinTestEmptyName()
        {
            var model = new glTFSkin()
            {
                name = "",
                inverseBindMatrices = 4,
                joints = new int[] { 1 },
            };

            var json = model.ToJson();

            // "name" = "", not excluded
            Assert.AreEqual(@"{""inverseBindMatrices"":4,""joints"":[1]}", json);
            Debug.Log(json);
        }
Пример #3
0
        public void SkinTest()
        {
            var model = new glTFSkin()
            {
                name   = "b",
                joints = new int[] { 1 },
            };

            var json = model.ToJson();

            Assert.AreEqual(@"{""inverseBindMatrices"":-1,""joints"":[1]}", json);
            Debug.Log(json);

            var c = new JsonSchemaValidationContext("")
            {
                EnableDiagnosisForNotRequiredFields = true,
            };
            var json2 = JsonSchema.FromType <glTFSkin>().Serialize(model, c);

            Assert.AreEqual(@"{""joints"":[1],""name"":""b""}", json2);
        }