void Awake() { if (__uniqueInstance != null) { Debug.LogError("Only one GATAudioInit should exist!"); Destroy(this); return; } __uniqueInstance = this; RuntimePlatform currentPlatform = Application.platform; PlatformSettings currentSettings = null; foreach (PlatformSettings settings in platformSettings) { if (settings.platform == currentPlatform) { currentSettings = settings; break; } } if (currentSettings == null) { #if GAT_DEBUG Debug.LogWarning("GATAudioInit not configured for current platform: " + currentPlatform.ToString()); #endif return; } if (AudioSettings.outputSampleRate != currentSettings.sampleRate) { #if UNITY_5 Debug.LogWarning("GATAudioInit's sample rate setting is obsolete in Unity 5. Target platform samplerate can be configured in project settings."); #else AudioSettings.outputSampleRate = currentSettings.sampleRate; GATInfo.SetRequestedSampleRate(currentSettings.sampleRate); #endif } Application.targetFrameRate = currentSettings.targetFrameRate; }
void Awake() { if( __uniqueInstance != null ) { Debug.LogError( "Only one GATAudioInit should exist!" ); Destroy( this ); return; } __uniqueInstance = this; RuntimePlatform currentPlatform = Application.platform; PlatformSettings currentSettings = null; foreach( PlatformSettings settings in platformSettings ) { if( settings.platform == currentPlatform ) { currentSettings = settings; break; } } if( currentSettings == null ) { #if GAT_DEBUG Debug.LogWarning( "GATAudioInit not configured for current platform: "+currentPlatform.ToString() ); #endif return; } if( AudioSettings.outputSampleRate != currentSettings.sampleRate ) { #if UNITY_5 Debug.LogWarning( "GATAudioInit's sample rate setting is obsolete in Unity 5. Target platform samplerate can be configured in project settings." ); #else AudioSettings.outputSampleRate = currentSettings.sampleRate; GATInfo.SetRequestedSampleRate( currentSettings.sampleRate ); #endif } Application.targetFrameRate = currentSettings.targetFrameRate; }