cohtml.Editor.DefineSymbolsConfigurator

Automatically manages scripting define symbols and pipeline configuration based on the currently active render pipeline and platform architecture. More…

Inherits from IPreprocessBuildWithReport, IActiveBuildTargetChanged

Public Functions

Name
voidInitialize()
Initializes the configurator automatically when the editor loads. Sets up update callbacks and initializes the define collection.
voidSetupRPDefine()
Sets up the correct render pipeline define symbols based on the active RP type.
boolIsSymbolDefined(string symbol)
Checks if a specific scripting define symbol is currently active.
voidAddDefineSymbols(params string [] symbolsToAdd)
Adds the specified scripting define symbols to the active build target configuration.
voidRemoveDefineSymbols(params string [] symbolsToRemove)
Removes the specified scripting define symbols from the active build target configuration.
voidUpdateDefineSymbols(string [] symbolsToRemove, string [] symbolsToAdd)
Efficiently removes and adds multiple scripting define symbols in a single pass. Prevents the editor from triggering multiple costly recompilations.
voidOnActiveBuildTargetChanged(BuildTarget previousTarget, BuildTarget newTarget)
voidOnPreprocessBuild(BuildReport report)
Called automatically before a build starts. Ensures correct architecture-related define symbols are applied.

Public Attributes

Name
intcallbackOrder

Detailed Description

class cohtml.Editor.DefineSymbolsConfigurator;

Automatically manages scripting define symbols and pipeline configuration based on the currently active render pipeline and platform architecture.

This utility ensures that the correct compiler symbols are defined or removed when the project settings changed.

Public Functions Documentation

function Initialize

static void Initialize()

Initializes the configurator automatically when the editor loads. Sets up update callbacks and initializes the define collection.

function SetupRPDefine

static void SetupRPDefine()

Sets up the correct render pipeline define symbols based on the active RP type.

function IsSymbolDefined

static bool IsSymbolDefined(
    string symbol
)

Checks if a specific scripting define symbol is currently active.

Parameters:

  • symbol The exact string of the define symbol to check.

Return: True if the symbol is defined for the current build target, otherwise false.

function AddDefineSymbols

static void AddDefineSymbols(
    params string [] symbolsToAdd
)

Adds the specified scripting define symbols to the active build target configuration.

Parameters:

  • symbolsToAdd A list of symbols to add.

function RemoveDefineSymbols

static void RemoveDefineSymbols(
    params string [] symbolsToRemove
)

Removes the specified scripting define symbols from the active build target configuration.

Parameters:

  • symbolsToRemove A list of symbols to remove.

function UpdateDefineSymbols

static void UpdateDefineSymbols(
    string [] symbolsToRemove,
    string [] symbolsToAdd
)

Efficiently removes and adds multiple scripting define symbols in a single pass. Prevents the editor from triggering multiple costly recompilations.

Parameters:

  • symbolsToRemove An array of symbols to remove. Can be null.
  • symbolsToAdd An array of symbols to add. Can be null.

function OnActiveBuildTargetChanged

void OnActiveBuildTargetChanged(
    BuildTarget previousTarget,
    BuildTarget newTarget
)

function OnPreprocessBuild

void OnPreprocessBuild(
    BuildReport report
)

Called automatically before a build starts. Ensures correct architecture-related define symbols are applied.

Parameters:

  • report Information about the current build.

Public Attributes Documentation

variable callbackOrder

int callbackOrder => 0;