public void MetaTest()
        {
            var model = new glTF_VRM_Meta()
            {
                allowedUserName      = "******",
                violentUssageName    = "Disallow",
                sexualUssageName     = "Disallow",
                commercialUssageName = "Disallow",
                licenseName          = "CC0",
            };

            var json = model.ToJson();

            Assert.AreEqual(@"{""texture"":-1,""allowedUserName"":""OnlyAuthor"",""violentUssageName"":""Disallow"",""sexualUssageName"":""Disallow"",""commercialUssageName"":""Disallow"",""licenseName"":""CC0""}", json);
            Debug.Log(json);

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

            // NOTE: New serializer outputs values which will not be used...
            Assert.AreEqual(@"{""allowedUserName"":""OnlyAuthor"",""violentUssageName"":""Disallow"",""sexualUssageName"":""Disallow"",""commercialUssageName"":""Disallow"",""licenseName"":""CC0""}", json2);
        }
        public void MetaTest()
        {
            var model = new glTF_VRM_Meta()
            {
                allowedUserName      = "******",
                violentUssageName    = "Disallow",
                sexualUssageName     = "Disallow",
                commercialUssageName = "Disallow",
                licenseName          = "CC0",
            };

            var json = model.ToJson();

            Assert.AreEqual(@"{""allowedUserName"":""OnlyAuthor"",""violentUssageName"":""Disallow"",""sexualUssageName"":""Disallow"",""commercialUssageName"":""Disallow"",""licenseName"":""CC0""}", json);
            Debug.Log(json);
        }
Exemple #3
0
        public void MetaTest()
        {
            var model = new glTF_VRM_Meta();

            var json = model.ToJson();

            Assert.AreEqual(@"{""texture"":-1}", json);
            Debug.Log(json);

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

            // NOTE: New serializer outputs values which will not be used...
            Assert.AreEqual(json, json2);
        }