Skip to content

DefinesUtility

Namespace: SideXP.Core.EditorOnly

public static class DefinesUtility

Utility class for managing scripting define symbols through code.

Fields

DEFINES_SEPARATOR

public const string DEFINES_SEPARATOR = ";"

Methods

GetDefines()

public static string[] GetDefines()

Gets the scripting define symbols from Player Settings for the current target platform.

Returns

Returns the defines from Player Settings.

GetDefines(BuildTargetGroup)

public static string[] GetDefines(BuildTargetGroup platform)

Gets the scripting define symbols from Player Settings for the given target platform.

Parameters

  • platform: The platform of which you want to get the scripting define symbols.

Returns

Returns the defines from Player Settings.

IsDefined(string)

public static bool IsDefined(string define)

Checks if the named scripting define symbol is set for the current target platform.

Parameters

  • define: The define you want to check.

Returns

Returns true if the define is set.

IsDefined(string, BuildTargetGroup)

public static bool IsDefined(string define, BuildTargetGroup platform)

Checks if the named scripting define symbol is set for the given target platform.

Parameters

  • define: The define you want to check.
  • platform: The platform for which you want to check the define.

Returns

Returns true if the define is set.

AddDefine(string)

public static bool AddDefine(string define)

Adds the named scripting define symbol for the current target platform.

Parameters

  • define: The define you want to add.

Returns

Returns true if the define has been added successfully, or false if it was already registered.

AddDefine(string, BuildTargetGroup)

public static bool AddDefine(string define, BuildTargetGroup platform)

Adds the named scripting define symbol for the given target platform.

Parameters

  • define: The define you want to add.
  • platform: The platform to which the define is added.

Returns

Returns true if the define has been added successfully, or false if it was already registered.

RemoveDefine(string)

public static bool RemoveDefine(string define)

Removes the named scripting define symbol for the current target platform.

Parameters

  • define: The define you want to remove.

Returns

Returns true if the define has been removed successfully, or false if it wasn't used.

RemoveDefine(string, BuildTargetGroup)

public static bool RemoveDefine(string define, BuildTargetGroup platform)

Removes the named scripting define symbol for the given target platform.

Parameters

  • define: The define you want to remove.
  • platform: The platform from which the define is removed.

Returns

Returns true if the define has been removed successfully, or false if it wasn't used.