Class PlatformTools
The platform support tools base interface.
Inheritance
Assembly: FlaxEngine.dll
File: Editor/Cooker/PlatformTools.h
Syntax
public class PlatformTools
Constructors
~PlatformTools()
Finalizes an instance of the PlatformTools class.
Declaration
public virtual ~PlatformTools() = default
Methods
GetArchitecture()
Gets the architecture of the platform.
Declaration
public virtual ArchitectureType GetArchitecture() const = 0
Returns
ArchitectureType
|
GetDisplayName()
Gets the name of the platform for UI and logging.
Declaration
public virtual Char* GetDisplayName() const = 0
Returns
Char
|
GetName()
Gets the name of the platform for filesystem cache directories, deps folder.
Declaration
public virtual Char* GetName() const = 0
Returns
Char
|
GetPlatform()
Gets the type of the platform.
Declaration
public virtual PlatformType GetPlatform() const = 0
Returns
PlatformType
|
GetTextureFormat(CookingData& data, TextureBase* texture, PixelFormat format)
Gets the texture format that is supported by the platform for a given texture.
Declaration
public virtual PixelFormat GetTextureFormat(CookingData& data, TextureBase* texture, PixelFormat format)
Parameters
CookingData
data
The cooking data. |
TextureBase
texture
The texture. |
PixelFormat
format
The texture format. |
Returns
PixelFormat
The target texture format for the platform. |
IsNativeCodeFile(CookingData& data, const String& file)
Checks if the given file is a native code.
Declaration
public virtual bool IsNativeCodeFile(CookingData& data, const String& file)
Parameters
CookingData
data
The cooking data. |
String
file
The file path. |
Returns
bool
True if it's a native file, otherwise false. |
LoadCache(CookingData& data, IBuildCache* cache, const Span<byte>& bytes)
Loads the build cache. Allows to invalidate any cached asset types based on the build settings for incremental builds (eg. invalidate textures/shaders).
Declaration
public virtual void LoadCache(CookingData& data, IBuildCache* cache, const Span<byte>& bytes)
Parameters
CookingData
data
The cooking data. |
IBuildCache
cache
|
Span<byte>
bytes
|
OnBuildEnded(CookingData& data, bool failed)
Called when game building ends.
Declaration
public virtual void OnBuildEnded(CookingData& data, bool failed)
Parameters
CookingData
data
The cooking data. |
bool
failed
True if build failed, otherwise false. |
OnBuildStarted(CookingData& data)
Called when game building starts.
Declaration
public virtual void OnBuildStarted(CookingData& data)
Parameters
CookingData
data
The cooking data. |
OnDeployBinaries(CookingData& data)
Called during binaries deployment.
Declaration
public virtual bool OnDeployBinaries(CookingData& data)
Parameters
CookingData
data
The cooking data. |
Returns
bool
True if failed, otherwise false. |
OnPostProcess(CookingData& data)
Called during staged build post-processing.
Declaration
public virtual bool OnPostProcess(CookingData& data)
Parameters
CookingData
data
The cooking data. |
Returns
bool
True if failed, otherwise false. |
OnRun(CookingData& data, String& executableFile, String& commandLineFormat, String& workingDir)
Called to run the cooked game build on device.
Declaration
public virtual void OnRun(CookingData& data, String& executableFile, String& commandLineFormat, String& workingDir)
Parameters
CookingData
data
The cooking data. |
String
executableFile
The game executable file path to run (or tool path to run if build should run on remote device). Empty if not supported. |
String
commandLineFormat
The command line for executable file. Use |
String
workingDir
Overriden custom working directory to use. Leave empty if use cooked data output folder. |
OnScriptsCompilationEnd(CookingData& data)
Called after scripts compilation. Can be used to cleanup or prepare data.
Declaration
public virtual bool OnScriptsCompilationEnd(CookingData& data)
Parameters
CookingData
data
The cooking data. |
Returns
bool
True if failed, otherwise false. |
OnScriptsCompilationStart(CookingData& data)
Called before scripts compilation. Can be used to inject custom configuration or prepare data.
Declaration
public virtual bool OnScriptsCompilationStart(CookingData& data)
Parameters
CookingData
data
The cooking data. |
Returns
bool
True if failed, otherwise false. |
OnScriptsStepDone(CookingData& data)
Called after compiled scripts deploy. Can be used to override or patch the output files.
Declaration
public virtual bool OnScriptsStepDone(CookingData& data)
Parameters
CookingData
data
The cooking data. |
Returns
bool
True if failed, otherwise false. |
SaveCache(CookingData& data, IBuildCache* cache)
Saves the build cache. Allows to store any build settings to be used for cache invalidation on incremental builds.
Declaration
public virtual Array<byte> SaveCache(CookingData& data, IBuildCache* cache)
Parameters
CookingData
data
The cooking data. |
IBuildCache
cache
|
Returns
Array<byte>
Data to cache, will be restored during next incremental build. |
UseAOT()
Gets the value indicating whenever platform requires AOT (needs C# assemblies to be precompiled).
Declaration
public virtual DotNetAOTModes UseAOT() const
Returns
DotNetAOTModes
|
UseSystemDotnet()
Gets the value indicating whenever platform supports using system-installed .Net Runtime.
Declaration
public virtual bool UseSystemDotnet() const
Returns
bool
|