11// This file is provided under The MIT License as part of Steamworks.NET.
2- // Copyright (c) 2013-2017 Riley Labrecque
2+ // Copyright (c) 2013-2018 Riley Labrecque
33// Please see the included LICENSE.txt for additional information.
44
55// Uncomment this out or add it to your custom platform defines to disable checking the plugin platform settings.
@@ -70,7 +70,7 @@ static void CopyFile(string path, string filename, bool bCheckDifference) {
7070 }
7171 }
7272
73- #if UNITY_5 || UNITY_2017
73+ #if UNITY_5 || UNITY_2017 || UNITY_2017_1_OR_NEWER
7474 static void SetPlatformSettings ( ) {
7575 foreach ( var plugin in PluginImporter . GetAllImporters ( ) ) {
7676 // Skip any null plugins, why is this a thing?!
@@ -87,11 +87,10 @@ static void SetPlatformSettings() {
8787 string filename = Path . GetFileName ( plugin . assetPath ) ;
8888
8989 switch ( filename ) {
90- case "CSteamworks.bundle " :
90+ case "libsteam_api.dylib " :
9191 didUpdate |= ResetPluginSettings ( plugin , "AnyCPU" , "OSX" ) ;
9292 didUpdate |= SetCompatibleWithOSX ( plugin ) ;
9393 break ;
94- case "libCSteamworks.so" :
9594 case "libsteam_api.so" :
9695 if ( plugin . assetPath . Contains ( "x86_64" ) ) {
9796 didUpdate |= ResetPluginSettings ( plugin , "x86_64" , "Linux" ) ;
@@ -102,16 +101,6 @@ static void SetPlatformSettings() {
102101 didUpdate |= SetCompatibleWithLinux ( plugin , BuildTarget . StandaloneLinux ) ;
103102 }
104103 break ;
105- case "CSteamworks.dll" :
106- if ( plugin . assetPath . Contains ( "x86_64" ) ) {
107- didUpdate |= ResetPluginSettings ( plugin , "x86_64" , "Windows" ) ;
108- didUpdate |= SetCompatibleWithWindows ( plugin , BuildTarget . StandaloneWindows64 ) ;
109- }
110- else {
111- didUpdate |= ResetPluginSettings ( plugin , "x86" , "Windows" ) ;
112- didUpdate |= SetCompatibleWithWindows ( plugin , BuildTarget . StandaloneWindows ) ;
113- }
114- break ;
115104 case "steam_api.dll" :
116105 case "steam_api64.dll" :
117106 if ( plugin . assetPath . Contains ( "x86_64" ) ) {
@@ -173,9 +162,13 @@ static bool ResetPluginSettings(PluginImporter plugin, string CPU, string OS) {
173162 static bool SetCompatibleWithOSX ( PluginImporter plugin ) {
174163 bool didUpdate = false ;
175164
165+ #if UNITY_2017_3_OR_NEWER
166+ didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSX , true ) ;
167+ #else
176168 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXIntel , true ) ;
177169 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXIntel64 , true ) ;
178170 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXUniversal , true ) ;
171+ #endif
179172
180173 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinux , false ) ;
181174 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinux64 , false ) ;
@@ -199,9 +192,13 @@ static bool SetCompatibleWithLinux(PluginImporter plugin, BuildTarget platform)
199192 }
200193 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinuxUniversal , true ) ;
201194
195+ #if UNITY_2017_3_OR_NEWER
196+ didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSX , false ) ;
197+ #else
202198 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXIntel , false ) ;
203199 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXIntel64 , false ) ;
204200 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXUniversal , false ) ;
201+ #endif
205202 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneWindows , false ) ;
206203 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneWindows64 , false ) ;
207204
@@ -223,9 +220,13 @@ static bool SetCompatibleWithWindows(PluginImporter plugin, BuildTarget platform
223220 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinux64 , false ) ;
224221 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinux , false ) ;
225222 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinuxUniversal , false ) ;
223+ #if UNITY_2017_3_OR_NEWER
224+ didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSX , false ) ;
225+ #else
226226 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXIntel , false ) ;
227227 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXIntel64 , false ) ;
228228 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXUniversal , false ) ;
229+ #endif
229230
230231 return didUpdate ;
231232 }
@@ -236,9 +237,13 @@ static bool SetCompatibleWithEditor(PluginImporter plugin) {
236237 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinux64 , false ) ;
237238 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinux , false ) ;
238239 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneLinuxUniversal , false ) ;
240+ #if UNITY_2017_3_OR_NEWER
241+ didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSX , false ) ;
242+ #else
239243 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXIntel , false ) ;
240244 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXIntel64 , false ) ;
241245 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneOSXUniversal , false ) ;
246+ #endif
242247 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneWindows , false ) ;
243248 didUpdate |= SetCompatibleWithPlatform ( plugin , BuildTarget . StandaloneWindows64 , false ) ;
244249
@@ -253,5 +258,5 @@ static bool SetCompatibleWithPlatform(PluginImporter plugin, BuildTarget platfor
253258 plugin . SetCompatibleWithPlatform ( platform , enable ) ;
254259 return true ;
255260 }
256- #endif // UNITY_5
261+ #endif // UNITY_5 || UNITY_2017 || UNITY_2017_1_OR_NEWER
257262}
0 commit comments