Example #1
0
        public AssetConversionOptions(AssetConversionInputOptions inputOptions, AssetConversionOutputOptions outputOptions)
        {
            if (inputOptions == null)
            {
                throw new ArgumentNullException(nameof(inputOptions));
            }
            if (outputOptions == null)
            {
                throw new ArgumentNullException(nameof(outputOptions));
            }

            InputOptions  = inputOptions;
            OutputOptions = outputOptions;
        }
        internal static AssetConversionOptions DeserializeAssetConversionOptions(JsonElement element)
        {
            AssetConversionInputOptions  inputLocation  = default;
            AssetConversionOutputOptions outputLocation = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("inputLocation"))
                {
                    inputLocation = AssetConversionInputOptions.DeserializeAssetConversionInputOptions(property.Value);
                    continue;
                }
                if (property.NameEquals("outputLocation"))
                {
                    outputLocation = AssetConversionOutputOptions.DeserializeAssetConversionOutputOptions(property.Value);
                    continue;
                }
            }
            return(new AssetConversionOptions(inputLocation, outputLocation));
        }