using System.Collections.Generic; using System.IO; using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif #if UNITY_STANDALONE_OSX && !UNITY_EDITOR namespace FMOD { public partial class VERSION { public const string dll = "fmodstudio" + dllSuffix; } } namespace FMOD.Studio { public partial class STUDIO_VERSION { public const string dll = "fmodstudio" + dllSuffix; } } #endif namespace FMODUnity { #if UNITY_EDITOR [InitializeOnLoad] #endif public class PlatformMac : Platform { static PlatformMac() { Settings.AddPlatformTemplate("52eb9df5db46521439908db3a29a1bbb"); } internal override string DisplayName { get { return "macOS"; } } internal override void DeclareRuntimePlatforms(Settings settings) { settings.DeclareRuntimePlatform(RuntimePlatform.OSXPlayer, this); } #if UNITY_EDITOR internal override IEnumerable GetBuildTargets() { yield return BuildTarget.StandaloneOSX; } internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.Mac; } } protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) { return new BinaryAssetFolderInfo("mac", "Plugins"); } protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) { yield return new FileRecord(string.Format("fmodstudio{0}.bundle", suffix)); } protected override IEnumerable GetOptionalBinaryFiles(BuildTarget buildTarget, bool allVariants) { yield return new FileRecord("gvraudio.bundle"); yield return new FileRecord("resonanceaudio.bundle"); } internal override bool SupportsAdditionalCPP(BuildTarget target) { return false; } #endif internal override string GetPluginPath(string pluginName) { string pluginPath = string.Format("{0}/{1}.bundle", GetPluginBasePath(), pluginName); if (System.IO.Directory.Exists((pluginPath))) { return pluginPath; } else { return string.Format("{0}/{1}.dylib", GetPluginBasePath(), pluginName); } } #if UNITY_EDITOR internal override OutputType[] ValidOutputTypes { get { return sValidOutputTypes; } } private static OutputType[] sValidOutputTypes = { new OutputType() { displayName = "Core Audio", outputType = FMOD.OUTPUTTYPE.COREAUDIO }, }; #endif internal override List DefaultCodecChannels { get { return staticCodecChannels; } } private static List staticCodecChannels = new List() { new CodecChannelCount { format = CodecType.FADPCM, channels = 0 }, new CodecChannelCount { format = CodecType.Vorbis, channels = 32 }, }; } }