Exemple #1
0
        public static void SerializeTo(ref UniGLTF.glTFExtension dst, VRMC_vrm extension)
        {
            if (dst is glTFExtensionImport)
            {
                throw new NotImplementedException();
            }

            if (!(dst is glTFExtensionExport extensions))
            {
                extensions = new glTFExtensionExport();
                dst        = extensions;
            }

            var f = new JsonFormatter();

            Serialize(f, extension);
            extensions.Add(VRMC_vrm.ExtensionName, f.GetStoreBytes());
        }
Exemple #2
0
        public static void Serialize(JsonFormatter f, VRMC_vrm value)
        {
            f.BeginMap();


            if (!string.IsNullOrEmpty(value.SpecVersion))
            {
                f.Key("specVersion");
                f.Value(value.SpecVersion);
            }

            if (value.Meta != null)
            {
                f.Key("meta");
                Serialize_Meta(f, value.Meta);
            }

            if (value.Humanoid != null)
            {
                f.Key("humanoid");
                Serialize_Humanoid(f, value.Humanoid);
            }

            if (value.FirstPerson != null)
            {
                f.Key("firstPerson");
                Serialize_FirstPerson(f, value.FirstPerson);
            }

            if (value.LookAt != null)
            {
                f.Key("lookAt");
                Serialize_LookAt(f, value.LookAt);
            }

            if (value.Expressions != null && value.Expressions.Count() >= 0)
            {
                f.Key("expressions");
                Serialize_Expressions(f, value.Expressions);
            }

            f.EndMap();
        }
Exemple #3
0
 Vrm10Data(GltfData data, VRMC_vrm vrm)
 {
     Data         = data;
     VrmExtension = vrm;
 }