Skip to content

Commit 07398a2

Browse files
authored
Fix platform dependent compilation for OSX (#96)
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.
1 parent 45c8f44 commit 07398a2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ private void InitializeQuickLinks()
10701070
AddQuickLink( m_skin.DriveIcon, "Files", Application.persistentDataPath );
10711071
#endif
10721072

1073-
#if UNITY_STANDALONE_OSX
1073+
#if UNITY_EDITOR_OSX || ( !UNITY_EDITOR && UNITY_STANDALONE_OSX )
10741074
// Add a quick link for user directory on Mac OS
10751075
string userDirectory = Environment.GetFolderPath( Environment.SpecialFolder.MyDocuments );
10761076
if( !string.IsNullOrEmpty( userDirectory ) )
@@ -1083,7 +1083,7 @@ private void InitializeQuickLinks()
10831083
{
10841084
QuickLink quickLink = quickLinks[i];
10851085
string quickLinkPath = Environment.GetFolderPath( quickLink.target );
1086-
#if UNITY_STANDALONE_OSX
1086+
#if UNITY_EDITOR_OSX || ( !UNITY_EDITOR && UNITY_STANDALONE_OSX )
10871087
// Documents folder must be appended manually on Mac OS
10881088
if( quickLink.target == Environment.SpecialFolder.MyDocuments && !string.IsNullOrEmpty( quickLinkPath ) )
10891089
quickLinkPath = Path.Combine( quickLinkPath, "Documents" );
@@ -1198,7 +1198,7 @@ private void RefreshDriveQuickLinks()
11981198
if( string.IsNullOrEmpty( drives[i] ) )
11991199
continue;
12001200

1201-
#if UNITY_STANDALONE_OSX
1201+
#if UNITY_EDITOR_OSX || ( !UNITY_EDITOR && UNITY_STANDALONE_OSX )
12021202
// There are a number of useless drives listed on Mac OS, filter them
12031203
if( drives[i] == "/" )
12041204
{

0 commit comments

Comments
 (0)