예제 #1
0
        //=============================================================================
        // process
        //=============================================================================
        /// <summary>
        /// set importer
        /// </summary>
        private void ImportCustomAudio(CustomAudioImporter customImporter)
        {
            if (customImporter == null || !customImporter.IsEnable)
            {
                return;
            }

            AudioImporter audioImporter = assetImporter as AudioImporter;
            CustomAudioImporterSettingValue customSettings = customImporter.ImporterSetting;

            if (customSettings.ForceToMono.IsConfigurable)
            {
                audioImporter.forceToMono = customSettings.ForceToMono;
            }

            if (customSettings.LoadInBackGround.IsConfigurable)
            {
                audioImporter.loadInBackground = customSettings.LoadInBackGround;
            }

#if UNITY_2017_1_OR_NEWER
            if (customSettings.Ambisonic.IsConfigurable)
            {
                audioImporter.ambisonic = customSettings.Ambisonic;
            }
#endif

            if (customSettings.PreloadAudioData.IsConfigurable)
            {
                audioImporter.preloadAudioData = customSettings.PreloadAudioData;
            }

            audioImporter.defaultSampleSettings = SetCustomAudioSettings(customSettings);

            // override settings
            if (customImporter.OverrideForAndroidSetting.IsConfigurable)
            {
                audioImporter.SetOverrideSampleSettings("Android", SetCustomAudioSettings(customImporter.OverrideForAndroidSetting));
            }
            else
            {
                audioImporter.ClearSampleSettingOverride("Android");
            }

            if (customImporter.OverrideForiOSSetting.IsConfigurable)
            {
                audioImporter.SetOverrideSampleSettings("iOS", SetCustomAudioSettings(customImporter.OverrideForiOSSetting));
            }
            else
            {
                audioImporter.ClearSampleSettingOverride("iOS");
            }

            if (customImporter.IsLogger)
            {
                Debug.Log(string.Format("CustomAudioImporter : " + customImporter.Log + "\nProcessed : {0}", assetPath));
            }
        }
 public CustomAudioImporter(CustomAudioImporter copy)
 {
     ImporterSetting           = new CustomAudioImporterValue(copy.ImporterSetting);
     OverrideForAndroidSetting = new CustomAudioImporterValue(copy.OverrideForAndroidSetting);
     OverrideForiOSSetting     = new CustomAudioImporterValue(copy.OverrideForiOSSetting);
 }