Skip to content
SiteEmail

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

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.
Name
intcallbackOrder
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.

static void Initialize()

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

static void SetupRPDefine()

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

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.

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.
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.
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.
void OnActiveBuildTargetChanged(
BuildTarget previousTarget,
BuildTarget newTarget
)
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.
int callbackOrder => 0;