private Internal_GetOverrideSampleSettings ( BuildTargetGroup platformGroup ) : |
||
platformGroup | BuildTargetGroup | |
Résultat |
public bool CurrentPlatformHasAutoTranslatedCompression() { BuildTargetGroup buildTargetGroup = BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget); IEnumerator <AudioImporter> enumerator = this.GetAllAudioImporterTargets().GetEnumerator(); try { while (enumerator.MoveNext()) { AudioImporter current = enumerator.Current; AudioCompressionFormat compressionFormat = current.defaultSampleSettings.compressionFormat; if (!current.Internal_ContainsSampleSettingsOverride(buildTargetGroup)) { AudioCompressionFormat format2 = current.Internal_GetOverrideSampleSettings(buildTargetGroup).compressionFormat; if (compressionFormat != format2) { return(true); } } } } finally { if (enumerator == null) { } enumerator.Dispose(); } return(false); }
private MultiValueStatus GetMultiValueStatus(BuildTargetGroup platform) { MultiValueStatus status; status.multiLoadType = false; status.multiSampleRateSetting = false; status.multiSampleRateOverride = false; status.multiCompressionFormat = false; status.multiQuality = false; status.multiConversionMode = false; AudioImporterSampleSettings settings; if (GetAllAudioImporterTargets().Any()) { //We have at least one AudioImporter AudioImporter firstImporter = GetAllAudioImporterTargets().First(); if (platform == BuildTargetGroup.Unknown) { settings = firstImporter.defaultSampleSettings; } else { settings = firstImporter.Internal_GetOverrideSampleSettings(platform); } foreach (AudioImporter importer in GetAllAudioImporterTargets().Except(new[] { firstImporter })) { AudioImporterSampleSettings compareSettings; if (platform == BuildTargetGroup.Unknown) { compareSettings = importer.defaultSampleSettings; } else { compareSettings = importer.Internal_GetOverrideSampleSettings(platform); } status.multiLoadType |= settings.loadType != compareSettings.loadType; status.multiSampleRateSetting |= settings.sampleRateSetting != compareSettings.sampleRateSetting; status.multiSampleRateOverride |= settings.sampleRateOverride != compareSettings.sampleRateOverride; status.multiCompressionFormat |= settings.compressionFormat != compareSettings.compressionFormat; status.multiQuality |= settings.quality != compareSettings.quality; status.multiConversionMode |= settings.conversionMode != compareSettings.conversionMode; } } return(status); }
private void ResetSettingsFromBackend() { if (GetAllAudioImporterTargets().Any()) { AudioImporter firstImporter = GetAllAudioImporterTargets().First(); //Just load the settings from the first importer for the default settings m_DefaultSampleSettings.settings = firstImporter.defaultSampleSettings; m_DefaultSampleSettings.ClearChangedFlags(); m_SampleSettingOverrides = new Dictionary <BuildTargetGroup, SampleSettingProperties>(); List <BuildPlatform> validPlatforms = BuildPlatforms.instance.GetValidPlatforms(); foreach (BuildPlatform platform in validPlatforms) { BuildTargetGroup platformGroup = platform.targetGroup; foreach (AudioImporter importer in GetAllAudioImporterTargets()) { if (importer.Internal_ContainsSampleSettingsOverride(platformGroup)) { SampleSettingProperties newProperties = new SampleSettingProperties(); newProperties.settings = importer.Internal_GetOverrideSampleSettings(platformGroup); m_SampleSettingOverrides[platformGroup] = newProperties; //Just grab the first settings we find from any of the importers. //This will be sorted later by checking if there are any differences between importers. break; } } //If we failed to find a valid override setting, just create a default one for use later. if (!m_SampleSettingOverrides.ContainsKey(platformGroup)) { SampleSettingProperties newProperties = new SampleSettingProperties(); newProperties.settings = firstImporter.Internal_GetOverrideSampleSettings(platformGroup); m_SampleSettingOverrides[platformGroup] = newProperties; } } } }
private bool ResetSettingsFromBackend() { if (this.GetAllAudioImporterTargets().Any <AudioImporter>()) { AudioImporter audioImporter = this.GetAllAudioImporterTargets().First <AudioImporter>(); this.m_DefaultSampleSettings.settings = audioImporter.defaultSampleSettings; this.m_DefaultSampleSettings.ClearChangedFlags(); this.m_SampleSettingOverrides = new Dictionary <BuildTargetGroup, AudioImporterInspector.SampleSettingProperties>(); using (List <BuildPlayerWindow.BuildPlatform> .Enumerator enumerator = BuildPlayerWindow.GetValidPlatforms().GetEnumerator()) { while (enumerator.MoveNext()) { BuildTargetGroup targetGroup = enumerator.Current.targetGroup; foreach (AudioImporter audioImporterTarget in this.GetAllAudioImporterTargets()) { if (audioImporterTarget.Internal_ContainsSampleSettingsOverride(targetGroup)) { this.m_SampleSettingOverrides[targetGroup] = new AudioImporterInspector.SampleSettingProperties() { settings = audioImporterTarget.Internal_GetOverrideSampleSettings(targetGroup) }; break; } } if (!this.m_SampleSettingOverrides.ContainsKey(targetGroup)) { this.m_SampleSettingOverrides[targetGroup] = new AudioImporterInspector.SampleSettingProperties() { settings = audioImporter.Internal_GetOverrideSampleSettings(targetGroup) } } ; } } } return(true); }
private AudioImporterInspector.MultiValueStatus GetMultiValueStatus(BuildTargetGroup platform) { AudioImporterInspector.MultiValueStatus multiValueStatus; multiValueStatus.multiLoadType = false; multiValueStatus.multiSampleRateSetting = false; multiValueStatus.multiSampleRateOverride = false; multiValueStatus.multiCompressionFormat = false; multiValueStatus.multiQuality = false; multiValueStatus.multiConversionMode = false; if (this.GetAllAudioImporterTargets().Any <AudioImporter>()) { AudioImporter audioImporter1 = this.GetAllAudioImporterTargets().First <AudioImporter>(); AudioImporterSampleSettings importerSampleSettings1 = platform != BuildTargetGroup.Unknown ? audioImporter1.Internal_GetOverrideSampleSettings(platform) : audioImporter1.defaultSampleSettings; IEnumerable <AudioImporter> audioImporterTargets = this.GetAllAudioImporterTargets(); AudioImporter[] audioImporterArray = new AudioImporter[1] { audioImporter1 }; foreach (AudioImporter audioImporter2 in audioImporterTargets.Except <AudioImporter>((IEnumerable <AudioImporter>)audioImporterArray)) { AudioImporterSampleSettings importerSampleSettings2 = platform != BuildTargetGroup.Unknown ? audioImporter2.Internal_GetOverrideSampleSettings(platform) : audioImporter2.defaultSampleSettings; multiValueStatus.multiLoadType |= importerSampleSettings1.loadType != importerSampleSettings2.loadType; multiValueStatus.multiSampleRateSetting |= importerSampleSettings1.sampleRateSetting != importerSampleSettings2.sampleRateSetting; multiValueStatus.multiSampleRateOverride |= (int)importerSampleSettings1.sampleRateOverride != (int)importerSampleSettings2.sampleRateOverride; multiValueStatus.multiCompressionFormat |= importerSampleSettings1.compressionFormat != importerSampleSettings2.compressionFormat; multiValueStatus.multiQuality |= (double)importerSampleSettings1.quality != (double)importerSampleSettings2.quality; multiValueStatus.multiConversionMode |= importerSampleSettings1.conversionMode != importerSampleSettings2.conversionMode; } } return(multiValueStatus); }