Example #1
0
        /// <inheritdoc />
        public override bool TryOverrideSettings(object settings)
        {
            if (settings is AudioImportSettings o)
            {
                _settings = o;
                return(true);
            }

            return(false);
        }
Example #2
0
        /// <summary>
        /// Tries the restore the asset import options from the target resource file.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="assetPath">The asset path.</param>
        /// <returns>True settings has been restored, otherwise false.</returns>
        public static bool TryRestore(ref AudioImportSettings options, string assetPath)
        {
            if (AudioImportEntry.Internal_GetAudioImportOptions(assetPath, out var internalOptions))
            {
                // Restore settings
                options.FromInternal(ref internalOptions);
                return(true);
            }

            return(false);
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AudioImportEntry"/> class.
 /// </summary>
 /// <param name="request">The import request.</param>
 public AudioImportEntry(ref Request request)
     : base(ref request)
 {
     // Try to restore target asset Audio import options (useful for fast reimport)
     AudioImportSettings.TryRestore(ref _settings, ResultUrl);
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AudioImportEntry"/> class.
 /// </summary>
 /// <param name="url">The source file url.</param>
 /// <param name="resultUrl">The result file url.</param>
 public AudioImportEntry(string url, string resultUrl)
     : base(url, resultUrl)
 {
     // Try to restore target asset Audio import options (usefull for fast reimport)
     AudioImportSettings.TryRestore(ref _settings, resultUrl);
 }