Exemplo n.º 1
0
        public static bool TryGet(glTFTexture texture, out glTF_KHR_texture_basisu basisuExtension)
        {
            if (texture?.extensions is glTFExtensionImport importedExtensions)
            {
                foreach (var kv in importedExtensions.ObjectItems())
                {
                    if (kv.Key.GetUtf8String() == ExtensionNameUt8)
                    {
                        basisuExtension = Deserialize(kv.Value);
                        return(basisuExtension != null);
                    }
                }
            }

            basisuExtension = default;
            return(false);
        }
Exemplo n.º 2
0
        public static void Serialize_gltf_textures_ITEM(JsonFormatter f, glTFTexture value)
        {
            f.BeginMap();


            if (value.sampler >= 0)
            {
                f.Key("sampler");
                f.Value(value.sampler);
            }

            if (value.source >= 0)
            {
                f.Key("source");
                f.Value(value.source);
            }

            if (value.extensions != null)
            {
                f.Key("extensions");
                value.extensions.Serialize(f);
            }

            if (value.extras != null)
            {
                f.Key("extras");
                value.extras.Serialize(f);
            }

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

            f.EndMap();
        }