Add editor option for build configuration when using cook and run.
This commit is contained in:
@@ -127,6 +127,12 @@ namespace FlaxEditor.Options
|
||||
BuildAction.NavMesh,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the build configuration to use when using Cook and Run option in the editor.
|
||||
/// </summary>
|
||||
[EditorDisplay("General"), EditorOrder(201), ExpandGroups, Tooltip("The build configuration to use when using Cook and Run option in the editor.")]
|
||||
public BuildConfiguration CookAndRunBuildConfiguration { get; set; } = BuildConfiguration.Development;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether perform automatic scripts reload on main window focus.
|
||||
/// </summary>
|
||||
|
||||
@@ -976,6 +976,7 @@ namespace FlaxEditor.Windows
|
||||
Editor.Log("Building and running");
|
||||
GameCooker.GetCurrentPlatform(out var platform, out var buildPlatform, out var buildConfiguration);
|
||||
var numberOfClients = Editor.Options.Options.Interface.NumberOfGameClientsToLaunch;
|
||||
var buildConfig = Editor.Options.Options.General.CookAndRunBuildConfiguration;
|
||||
for (int i = 0; i < numberOfClients; i++)
|
||||
{
|
||||
var buildOptions = BuildOptions.AutoRun;
|
||||
@@ -988,7 +989,7 @@ namespace FlaxEditor.Windows
|
||||
{
|
||||
Output = _buildTabProxy.PerPlatformOptions[platform].Output,
|
||||
Platform = buildPlatform,
|
||||
Mode = buildConfiguration,
|
||||
Mode = buildConfig,
|
||||
},
|
||||
Options = buildOptions,
|
||||
});
|
||||
@@ -1003,6 +1004,7 @@ namespace FlaxEditor.Windows
|
||||
Editor.Log("Running cooked build");
|
||||
GameCooker.GetCurrentPlatform(out var platform, out var buildPlatform, out var buildConfiguration);
|
||||
var numberOfClients = Editor.Options.Options.Interface.NumberOfGameClientsToLaunch;
|
||||
var buildConfig = Editor.Options.Options.General.CookAndRunBuildConfiguration;
|
||||
for (int i = 0; i < numberOfClients; i++)
|
||||
{
|
||||
_buildingQueue.Enqueue(new QueueItem
|
||||
@@ -1011,7 +1013,7 @@ namespace FlaxEditor.Windows
|
||||
{
|
||||
Output = _buildTabProxy.PerPlatformOptions[platform].Output,
|
||||
Platform = buildPlatform,
|
||||
Mode = buildConfiguration,
|
||||
Mode = buildConfig,
|
||||
},
|
||||
Options = BuildOptions.AutoRun | BuildOptions.NoCook,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user