Table of Contents

Class EditorExportPlatformExtension

Namespace
Godot
Assembly
GodotSharpEditor.dll

External EditorExportPlatform implementations should inherit from this class.

To use EditorExportPlatform, register it using the AddExportPlatform(EditorExportPlatform) method first.

public class EditorExportPlatformExtension : EditorExportPlatform, IDisposable
Inheritance
EditorExportPlatformExtension
Implements
Inherited Members

Constructors

EditorExportPlatformExtension()

public EditorExportPlatformExtension()

Methods

GetConfigError()

Returns current configuration error message text. This method should be called only from the _CanExport(EditorExportPreset, bool), _HasValidExportConfiguration(EditorExportPreset, bool), or _HasValidProjectConfiguration(EditorExportPreset) implementations.

public string GetConfigError()

Returns

string

GetConfigMissingTemplates()

Returns true is export templates are missing from the current configuration. This method should be called only from the _CanExport(EditorExportPreset, bool), _HasValidExportConfiguration(EditorExportPreset, bool), or _HasValidProjectConfiguration(EditorExportPreset) implementations.

public bool GetConfigMissingTemplates()

Returns

bool

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

SetConfigError(string)

Sets current configuration error message text. This method should be called only from the _CanExport(EditorExportPreset, bool), _HasValidExportConfiguration(EditorExportPreset, bool), or _HasValidProjectConfiguration(EditorExportPreset) implementations.

public void SetConfigError(string errorText)

Parameters

errorText string

SetConfigMissingTemplates(bool)

Set to true is export templates are missing from the current configuration. This method should be called only from the _CanExport(EditorExportPreset, bool), _HasValidExportConfiguration(EditorExportPreset, bool), or _HasValidProjectConfiguration(EditorExportPreset) implementations.

public void SetConfigMissingTemplates(bool missingTemplates)

Parameters

missingTemplates bool

_CanExport(EditorExportPreset, bool)

Optional.

Returns true, if specified preset is valid and can be exported. Use SetConfigError(string) and SetConfigMissingTemplates(bool) to set error details.

Usual implementation can call _HasValidExportConfiguration(EditorExportPreset, bool) and _HasValidProjectConfiguration(EditorExportPreset) to determine if export is possible.

public virtual bool _CanExport(EditorExportPreset preset, bool debug)

Parameters

preset EditorExportPreset
debug bool

Returns

bool

_Cleanup()

Optional.

Called by the editor before platform is unregistered.

public virtual void _Cleanup()

_ExportPack(EditorExportPreset, bool, string, DebugFlags)

Optional.

Creates a PCK archive at path for the specified preset.

This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" disabled, and PCK is selected as a file type.

public virtual Error _ExportPack(EditorExportPreset preset, bool debug, string path, EditorExportPlatform.DebugFlags flags)

Parameters

preset EditorExportPreset
debug bool
path string
flags EditorExportPlatform.DebugFlags

Returns

Error

_ExportPackPatch(EditorExportPreset, bool, string, string[], DebugFlags)

Optional.

Creates a patch PCK archive at path for the specified preset, containing only the files that have changed since the last patch.

This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" enabled, and PCK is selected as a file type.

Note: The patches provided in patches have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead.

public virtual Error _ExportPackPatch(EditorExportPreset preset, bool debug, string path, string[] patches, EditorExportPlatform.DebugFlags flags)

Parameters

preset EditorExportPreset
debug bool
path string
patches string[]
flags EditorExportPlatform.DebugFlags

Returns

Error

_ExportProject(EditorExportPreset, bool, string, DebugFlags)

Required.

Creates a full project at path for the specified preset.

This method is called when "Export" button is pressed in the export dialog.

This method implementation can call SavePack(EditorExportPreset, bool, string, bool) or SaveZip(EditorExportPreset, bool, string) to use default PCK/ZIP export process, or calls ExportProjectFiles(EditorExportPreset, bool, Callable, Callable) and implement custom callback for processing each exported file.

public virtual Error _ExportProject(EditorExportPreset preset, bool debug, string path, EditorExportPlatform.DebugFlags flags)

Parameters

preset EditorExportPreset
debug bool
path string
flags EditorExportPlatform.DebugFlags

Returns

Error

_ExportZip(EditorExportPreset, bool, string, DebugFlags)

Optional.

Create a ZIP archive at path for the specified preset.

This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" disabled, and ZIP is selected as a file type.

public virtual Error _ExportZip(EditorExportPreset preset, bool debug, string path, EditorExportPlatform.DebugFlags flags)

Parameters

preset EditorExportPreset
debug bool
path string
flags EditorExportPlatform.DebugFlags

Returns

Error

_ExportZipPatch(EditorExportPreset, bool, string, string[], DebugFlags)

Optional.

Create a ZIP archive at path for the specified preset, containing only the files that have changed since the last patch.

This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" enabled, and ZIP is selected as a file type.

Note: The patches provided in patches have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead.

public virtual Error _ExportZipPatch(EditorExportPreset preset, bool debug, string path, string[] patches, EditorExportPlatform.DebugFlags flags)

Parameters

preset EditorExportPreset
debug bool
path string
patches string[]
flags EditorExportPlatform.DebugFlags

Returns

Error

_GetBinaryExtensions(EditorExportPreset)

Required.

Returns array of supported binary extensions for the full project export.

public virtual string[] _GetBinaryExtensions(EditorExportPreset preset)

Parameters

preset EditorExportPreset

Returns

string[]

_GetDebugProtocol()

Optional.

Returns protocol used for remote debugging. Default implementation return tcp://.

public virtual string _GetDebugProtocol()

Returns

string

_GetDeviceArchitecture(int)

Optional.

Returns device architecture for one-click deploy.

public virtual string _GetDeviceArchitecture(int device)

Parameters

device int

Returns

string

_GetExportOptionVisibility(EditorExportPreset, string)

Optional.

Validates option and returns visibility for the specified preset. Default implementation return true for all options.

public virtual bool _GetExportOptionVisibility(EditorExportPreset preset, string option)

Parameters

preset EditorExportPreset
option string

Returns

bool

_GetExportOptionWarning(EditorExportPreset, StringName)

Optional.

Validates option and returns warning message for the specified preset. Default implementation return empty string for all options.

public virtual string _GetExportOptionWarning(EditorExportPreset preset, StringName option)

Parameters

preset EditorExportPreset
option StringName

Returns

string

_GetExportOptions()

Optional.

Returns a property list, as an Array of dictionaries. Each Dictionary must at least contain the name: StringName and type: Variant.Type entries.

Additionally, the following keys are supported:

- hint: PropertyHint

- hint_string: String

- usage: PropertyUsageFlags

- class_name: StringName

- default_value: Variant, default value of the property.

- update_visibility: bool, if set to true, _GetExportOptionVisibility(EditorExportPreset, string) is called for each property when this property is changed.

- required: bool, if set to true, this property warnings are critical, and should be resolved to make export possible. This value is a hint for the _HasValidExportConfiguration(EditorExportPreset, bool) implementation, and not used by the engine directly.

See also _GetPropertyList().

public virtual Array<Dictionary> _GetExportOptions()

Returns

Array<Dictionary>

Required.

Returns platform logo displayed in the export dialog, logo should be 32x32 adjusted to the current editor scale, see GetEditorScale().

public virtual Texture2D _GetLogo()

Returns

Texture2D

_GetName()

Required.

Returns export platform name.

public virtual string _GetName()

Returns

string

_GetOptionIcon(int)

Optional.

Returns one-click deploy menu item icon for the specified device, icon should be 16x16 adjusted to the current editor scale, see GetEditorScale().

public virtual ImageTexture _GetOptionIcon(int device)

Parameters

device int

Returns

ImageTexture

_GetOptionLabel(int)

Optional.

Returns one-click deploy menu item label for the specified device.

public virtual string _GetOptionLabel(int device)

Parameters

device int

Returns

string

_GetOptionTooltip(int)

Optional.

Returns one-click deploy menu item tooltip for the specified device.

public virtual string _GetOptionTooltip(int device)

Parameters

device int

Returns

string

_GetOptionsCount()

Optional.

Returns number one-click deploy devices (or other one-click option displayed in the menu).

public virtual int _GetOptionsCount()

Returns

int

_GetOptionsTooltip()

Optional.

Returns tooltip of the one-click deploy menu button.

public virtual string _GetOptionsTooltip()

Returns

string

_GetOsName()

Required.

Returns target OS name.

public virtual string _GetOsName()

Returns

string

_GetPlatformFeatures()

Required.

Returns array of platform specific features.

public virtual string[] _GetPlatformFeatures()

Returns

string[]

_GetPresetFeatures(EditorExportPreset)

Required.

Returns array of platform specific features for the specified preset.

public virtual string[] _GetPresetFeatures(EditorExportPreset preset)

Parameters

preset EditorExportPreset

Returns

string[]

_GetRunIcon()

Optional.

Returns icon of the one-click deploy menu button, icon should be 16x16 adjusted to the current editor scale, see GetEditorScale().

public virtual Texture2D _GetRunIcon()

Returns

Texture2D

_HasValidExportConfiguration(EditorExportPreset, bool)

Required.

Returns true if export configuration is valid.

public virtual bool _HasValidExportConfiguration(EditorExportPreset preset, bool debug)

Parameters

preset EditorExportPreset
debug bool

Returns

bool

_HasValidProjectConfiguration(EditorExportPreset)

Required.

Returns true if project configuration is valid.

public virtual bool _HasValidProjectConfiguration(EditorExportPreset preset)

Parameters

preset EditorExportPreset

Returns

bool

_IsExecutable(string)

Optional.

Returns true if specified file is a valid executable (native executable or script) for the target platform.

public virtual bool _IsExecutable(string path)

Parameters

path string

Returns

bool

_PollExport()

Optional.

Returns true if one-click deploy options are changed and editor interface should be updated.

public virtual bool _PollExport()

Returns

bool

_Run(EditorExportPreset, int, DebugFlags)

Optional.

This method is called when device one-click deploy menu option is selected.

Implementation should export project to a temporary location, upload and run it on the specific device, or perform another action associated with the menu item.

public virtual Error _Run(EditorExportPreset preset, int device, EditorExportPlatform.DebugFlags debugFlags)

Parameters

preset EditorExportPreset
device int
debugFlags EditorExportPlatform.DebugFlags

Returns

Error

_ShouldUpdateExportOptions()

Optional.

Returns true if export options list is changed and presets should be updated.

public virtual bool _ShouldUpdateExportOptions()

Returns

bool