@@ -188,6 +188,7 @@ public struct BuildPlayerOptions
188188 public BuildTargetGroup targetGroup { get ; set ; }
189189 public BuildTarget target { get ; set ; }
190190 public BuildOptions options { get ; set ; }
191+ public string [ ] extraScriptingDefines { get ; set ; }
191192 }
192193
193194 // Lets you programmatically build players or AssetBundles which can be loaded from the web.
@@ -262,10 +263,10 @@ public static BuildReport BuildPlayer(string[] levels, string locationPathName,
262263
263264 public static BuildReport BuildPlayer ( BuildPlayerOptions buildPlayerOptions )
264265 {
265- return BuildPlayer ( buildPlayerOptions . scenes , buildPlayerOptions . locationPathName , buildPlayerOptions . assetBundleManifestPath , buildPlayerOptions . targetGroup , buildPlayerOptions . target , buildPlayerOptions . options ) ;
266+ return BuildPlayer ( buildPlayerOptions . scenes , buildPlayerOptions . locationPathName , buildPlayerOptions . assetBundleManifestPath , buildPlayerOptions . targetGroup , buildPlayerOptions . target , buildPlayerOptions . options , buildPlayerOptions . extraScriptingDefines ) ;
266267 }
267268
268- private static BuildReport BuildPlayer ( string [ ] scenes , string locationPathName , string assetBundleManifestPath , BuildTargetGroup buildTargetGroup , BuildTarget target , BuildOptions options )
269+ private static BuildReport BuildPlayer ( string [ ] scenes , string locationPathName , string assetBundleManifestPath , BuildTargetGroup buildTargetGroup , BuildTarget target , BuildOptions options , string [ ] extraScriptingDefines )
269270 {
270271 if ( isBuildingPlayer )
271272 throw new InvalidOperationException ( "Cannot start a new build because there is already a build in progress." ) ;
@@ -279,7 +280,7 @@ private static BuildReport BuildPlayer(string[] scenes, string locationPathName,
279280
280281 try
281282 {
282- return BuildPlayerInternal ( scenes , locationPathName , assetBundleManifestPath , buildTargetGroup , target , options ) ;
283+ return BuildPlayerInternal ( scenes , locationPathName , assetBundleManifestPath , buildTargetGroup , target , options , extraScriptingDefines ) ;
283284 }
284285 catch ( System . Exception exception )
285286 {
@@ -353,7 +354,7 @@ internal static string BuildStreamedSceneAssetBundle(string[] levels, string loc
353354 crc = 0 ;
354355 try
355356 {
356- var report = BuildPlayerInternal ( levels , locationPath , null , buildTargetGroup , target , options | BuildOptions . BuildAdditionalStreamedScenes | BuildOptions . ComputeCRC ) ;
357+ var report = BuildPlayerInternal ( levels , locationPath , null , buildTargetGroup , target , options | BuildOptions . BuildAdditionalStreamedScenes | BuildOptions . ComputeCRC , new string [ ] { } ) ;
357358 crc = report . summary . crc ;
358359
359360 var summary = report . SummarizeErrors ( ) ;
@@ -375,19 +376,19 @@ public static string BuildStreamedSceneAssetBundle(string[] levels, string locat
375376 return BuildStreamedSceneAssetBundle ( levels , locationPath , target , out crc , 0 ) ;
376377 }
377378
378- private static BuildReport BuildPlayerInternal ( string [ ] levels , string locationPathName , string assetBundleManifestPath , BuildTargetGroup buildTargetGroup , BuildTarget target , BuildOptions options )
379+ private static BuildReport BuildPlayerInternal ( string [ ] levels , string locationPathName , string assetBundleManifestPath , BuildTargetGroup buildTargetGroup , BuildTarget target , BuildOptions options , string [ ] extraScriptingDefines )
379380 {
380381 if ( ! BuildPlayerWindow . DefaultBuildMethods . IsBuildPathValid ( locationPathName ) )
381382 throw new Exception ( "Invalid Build Path: " + locationPathName ) ;
382383
383- return BuildPlayerInternalNoCheck ( levels , locationPathName , assetBundleManifestPath , buildTargetGroup , target , options , false ) ;
384+ return BuildPlayerInternalNoCheck ( levels , locationPathName , assetBundleManifestPath , buildTargetGroup , target , options , extraScriptingDefines , false ) ;
384385 }
385386
386387 // Is a player currently building?
387388 public static extern bool isBuildingPlayer { [ FreeFunction ( "IsBuildingPlayer" ) ] get ; }
388389
389390 // Just like BuildPlayer, but does not check for Pro license. Used from build player dialog.
390- internal static extern BuildReport BuildPlayerInternalNoCheck ( string [ ] levels , string locationPathName , string assetBundleManifestPath , BuildTargetGroup buildTargetGroup , BuildTarget target , BuildOptions options , bool delayToAfterScriptReload ) ;
391+ internal static extern BuildReport BuildPlayerInternalNoCheck ( string [ ] levels , string locationPathName , string assetBundleManifestPath , BuildTargetGroup buildTargetGroup , BuildTarget target , BuildOptions options , string [ ] extraScriptingDefines , bool delayToAfterScriptReload ) ;
391392
392393#pragma warning disable 618
393394
0 commit comments