From de66d97f9af4e7af9ecb6001d451588bbc103cdc Mon Sep 17 00:00:00 2001 From: Bastian Clausdorff Date: Mon, 25 Mar 2024 20:28:23 +0100 Subject: [PATCH] Fix platform dependent compilation for OSX On macOS, we want the code blocks take effect in the Editor, regardless of the chosen build target. So in addition to `UNITY_STANDALONE_OSX`, we also have to check for `UNITY_EDITOR_OSX`. And on Windows, we don't want these code blocks to take effect in the Editor, even though macOS has been selected as the build target. So we only should check for `UNITY_STANDALONE_OSX` when not running in the Editor. --- Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs b/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs index a5ea060..8c6b5a6 100644 --- a/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs +++ b/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs @@ -1070,7 +1070,7 @@ private void InitializeQuickLinks() AddQuickLink( m_skin.DriveIcon, "Files", Application.persistentDataPath ); #endif -#if UNITY_STANDALONE_OSX +#if UNITY_EDITOR_OSX || ( !UNITY_EDITOR && UNITY_STANDALONE_OSX ) // Add a quick link for user directory on Mac OS string userDirectory = Environment.GetFolderPath( Environment.SpecialFolder.MyDocuments ); if( !string.IsNullOrEmpty( userDirectory ) ) @@ -1083,7 +1083,7 @@ private void InitializeQuickLinks() { QuickLink quickLink = quickLinks[i]; string quickLinkPath = Environment.GetFolderPath( quickLink.target ); -#if UNITY_STANDALONE_OSX +#if UNITY_EDITOR_OSX || ( !UNITY_EDITOR && UNITY_STANDALONE_OSX ) // Documents folder must be appended manually on Mac OS if( quickLink.target == Environment.SpecialFolder.MyDocuments && !string.IsNullOrEmpty( quickLinkPath ) ) quickLinkPath = Path.Combine( quickLinkPath, "Documents" ); @@ -1198,7 +1198,7 @@ private void RefreshDriveQuickLinks() if( string.IsNullOrEmpty( drives[i] ) ) continue; -#if UNITY_STANDALONE_OSX +#if UNITY_EDITOR_OSX || ( !UNITY_EDITOR && UNITY_STANDALONE_OSX ) // There are a number of useless drives listed on Mac OS, filter them if( drives[i] == "/" ) {