Class GameCooker
Game building service. Processes project files and outputs build game for a target platform.
Inheritance
Namespace: FlaxEditor
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public static class GameCooker : ObjectProperties
CurrentData
Gets the current build data. Valid only during active build process.
Declaration
[Unmanaged]
public static CookingData CurrentData { get; }Property Value
| CookingData 
 | 
IsCancelRequested
Determines whether building cancel has been requested.
Declaration
[Unmanaged]
public static bool IsCancelRequested { get; }Property Value
| System.Boolean 
 | 
IsRunning
Determines whether game building is running.
Declaration
[Unmanaged]
public static bool IsRunning { get; }Property Value
| System.Boolean 
 | 
Methods
add_Event(GameCooker.BuildEventDelegate)
Declaration
public static void add_Event(GameCooker.BuildEventDelegate value)Parameters
| GameCooker.BuildEventDelegate
        value 
 | 
add_Progress(GameCooker.BuildProgressDelegate)
Declaration
public static void add_Progress(GameCooker.BuildProgressDelegate value)Parameters
| GameCooker.BuildProgressDelegate
        value 
 | 
Build(BuildPlatform, BuildConfiguration, String, BuildOptions, String[], String, String)
Starts building game for the specified platform.
Declaration
[Unmanaged]
public static bool Build(BuildPlatform platform, BuildConfiguration configuration, string outputPath, BuildOptions options, string[] customDefines, string preset = null, string presetTarget = null)Parameters
| BuildPlatform
        platform The target platform. | 
| BuildConfiguration
        configuration The build configuration. | 
| System.String
        outputPath The output path (output directory). | 
| BuildOptions
        options The build options. | 
| System.String[]
        customDefines The list of custom defines passed to the build tool when compiling project scripts. Can be used in build scripts for configuration (Configuration.CustomDefines). | 
| System.String
        preset The name of build preset used for cooking (can be used by editor and game plugins). | 
| System.String
        presetTarget The name of build preset target used for cooking (can be used by editor and game plugins). | 
Returns
| System.Boolean True if failed to start the build, otherwise false. | 
Cancel(Boolean)
Sends a cancel event to the game building service.
Declaration
[Unmanaged]
public static void Cancel(bool waitForEnd = false)Parameters
| System.Boolean
        waitForEnd If set to  | 
GetCurrentPlatform(out PlatformType, out BuildPlatform, out BuildConfiguration)
Gets the current Editor build info (platform, configuration, etc).
Declaration
[Unmanaged]
public static void GetCurrentPlatform(out PlatformType platform, out BuildPlatform buildPlatform, out BuildConfiguration buildConfiguration)Parameters
| PlatformType
        platform 
 | 
| BuildPlatform
        buildPlatform 
 | 
| BuildConfiguration
        buildConfiguration 
 | 
GetPlatformType(BuildPlatform)
Gets the type of the platform from the game build platform type.
Declaration
public static PlatformType GetPlatformType(BuildPlatform buildPlatform)Parameters
| BuildPlatform
        buildPlatform The build platform. | 
Returns
| PlatformType The run-type platform type. | 
remove_Event(GameCooker.BuildEventDelegate)
Declaration
public static void remove_Event(GameCooker.BuildEventDelegate value)Parameters
| GameCooker.BuildEventDelegate
        value 
 | 
remove_Progress(GameCooker.BuildProgressDelegate)
Declaration
public static void remove_Progress(GameCooker.BuildProgressDelegate value)Parameters
| GameCooker.BuildProgressDelegate
        value 
 | 
Events
CollectAssets
Occurs when building collects assets to cook.
Declaration
public static event Action<List<Guid>> CollectAssetsEvent Type
| System.Action<System.Collections.Generic.List<System.Guid>> 
 | 
DeployFiles
Occurs when game files and data is deployed.
Declaration
[Unmanaged]
public static event Action DeployFilesEvent Type
| System.Action 
 | 
Event
Occurs when building event rises.
Declaration
public static event GameCooker.BuildEventDelegate EventEvent Type
| GameCooker.BuildEventDelegate 
 | 
PackageFiles
Occurs when game files and data are ready to be packaged. Called only if game is about to packaged, otherwise this step is skipped.
Declaration
[Unmanaged]
public static event Action PackageFilesEvent Type
| System.Action 
 | 
PostProcessFiles
Occurs when game files and data are deployed and can be post-processed.
Declaration
[Unmanaged]
public static event Action PostProcessFilesEvent Type
| System.Action 
 | 
Progress
Occurs when building game progress fires.
Declaration
public static event GameCooker.BuildProgressDelegate ProgressEvent Type
| GameCooker.BuildProgressDelegate 
 |