Class ScyllaCoreConfiguration
Core framework configuration asset containing initialization settings that govern how ScyllaBootstrap starts up the framework and whether the JSON-based config file system is active at runtime.
This configuration can be assigned directly to ScyllaBootstrap in the Inspector
to control framework behavior, or loaded automatically from the
Resources/Config/ folder at runtime via LoadDefault().
When neither is available, ScyllaBootstrap falls back to built-in default values.
The global config file switches on this asset (ConfigFilesEnabledInDebugBuild, ConfigFilesEnabledInProductionBuild, CreateConfigFiles) act as master gates passed to ConfigFileManager during bootstrap. They determine whether JSON overrides are loaded for any configuration in the project. Per-configuration switches inherited from ScyllaConfiguration only take effect when the global gate is open.
Logging settings are managed separately via ScyllaLoggerConfiguration.
Inherited Members
Namespace: Scylla.Core.Config
Assembly: ScyllaCore.dll
Syntax
[CreateAssetMenu(fileName = "Scylla Core Configuration", menuName = "Scylla/Core/Core Configuration", order = 0)]
public sealed class ScyllaCoreConfiguration : ScyllaConfiguration
Fields
CONFIG_FILENAME
Filename for auto-loading this configuration.
Declaration
public const string CONFIG_FILENAME = "Scylla Core Configuration"
Field Value
| Type | Description |
|---|---|
| string |
DEFAULT_INIT_DELAY
Default initialization delay in seconds.
Declaration
public const float DEFAULT_INIT_DELAY = 1
Field Value
| Type | Description |
|---|---|
| float |
GROUP_DEBUG_DRAW
Config file group name for Debug Draw settings.
Declaration
public const string GROUP_DEBUG_DRAW = "Debug Draw"
Field Value
| Type | Description |
|---|---|
| string |
GROUP_INITIALIZATION
Config file group name used when reading and writing the initialization section
of the JSON override file. Corresponds to the [Initialization] group that
contains entries such as KEY_INITIALIZATION_DELAY.
Declaration
public const string GROUP_INITIALIZATION = "Initialization"
Field Value
| Type | Description |
|---|---|
| string |
KEY_DEBUG_DRAW_DEFAULT_SEGMENTS
Config file key for the default circle/ellipse tessellation segment count.
Declaration
public const string KEY_DEBUG_DRAW_DEFAULT_SEGMENTS = "DefaultSegments"
Field Value
| Type | Description |
|---|---|
| string |
KEY_DEBUG_DRAW_DEFAULT_THICKNESS
Config file key for the default world-space line thickness.
Declaration
public const string KEY_DEBUG_DRAW_DEFAULT_THICKNESS = "DefaultThickness"
Field Value
| Type | Description |
|---|---|
| string |
KEY_DEBUG_DRAW_MAX_COMMANDS
Config file key for the maximum number of draw commands per frame.
Declaration
public const string KEY_DEBUG_DRAW_MAX_COMMANDS = "MaxCommands"
Field Value
| Type | Description |
|---|---|
| string |
KEY_DEBUG_DRAW_MESH_POOL_CAPACITY
Config file key for the initial mesh pool capacity.
Declaration
public const string KEY_DEBUG_DRAW_MESH_POOL_CAPACITY = "MeshPoolCapacity"
Field Value
| Type | Description |
|---|---|
| string |
KEY_DEBUG_DRAW_MESH_POOL_MAX_SIZE
Config file key for the maximum mesh pool size.
Declaration
public const string KEY_DEBUG_DRAW_MESH_POOL_MAX_SIZE = "MeshPoolMaxSize"
Field Value
| Type | Description |
|---|---|
| string |
KEY_INITIALIZATION_DELAY
Config file key for the InitializationDelay property within the GROUP_INITIALIZATION group. Used by ApplyConfigFileOverrides(ConfigFile) to locate the override value in a ConfigFile, and by ExportToConfigFile() when writing the current value back to disk.
Declaration
public const string KEY_INITIALIZATION_DELAY = "InitializationDelay"
Field Value
| Type | Description |
|---|---|
| string |
MAX_INIT_DELAY
Maximum allowed initialization delay in seconds.
Declaration
public const float MAX_INIT_DELAY = 5
Field Value
| Type | Description |
|---|---|
| float |
MIN_INIT_DELAY
Minimum allowed initialization delay in seconds.
Declaration
public const float MIN_INIT_DELAY = 0
Field Value
| Type | Description |
|---|---|
| float |
Properties
ConfigFilesEnabledInDebugBuild
Gets whether the JSON config file system is globally enabled for all Scylla configurations when running in debug builds (Unity Editor or Development Builds).
This is the global master gate checked by ConfigFileManager. Even if a
specific configuration has its own per-configuration switch enabled, overrides will not
be loaded unless this global flag is also true for the current build type.
Use IsConfigFilesEnabledForCurrentBuild() to query the effective value for
the currently running build.
Declaration
public bool ConfigFilesEnabledInDebugBuild { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
ConfigFilesEnabledInProductionBuild
Gets whether the JSON config file system is globally enabled for all Scylla configurations when running in production (non-development, non-editor) builds.
This is the global master gate checked by ConfigFileManager in release
builds. Even if a specific configuration has its per-configuration switch enabled,
overrides will not be loaded unless this global flag is also true.
Use IsConfigFilesEnabledForCurrentBuild() to query the effective value for
the currently running build.
Declaration
public bool ConfigFilesEnabledInProductionBuild { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
CreateConfigFiles
Gets whether ConfigFileManager should automatically create a JSON config file with default values in the user documents folder for any configuration that does not already have one there on application launch.
This switch controls the global auto-creation behavior. It operates independently from ConfigFilesEnabledInDebugBuild and ConfigFilesEnabledInProductionBuild: files can be created even when override-reading is disabled, so users receive a pre-populated template to edit without requiring the override gate to be open.
Declaration
public bool CreateConfigFiles { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
DebugDrawDefaultSegments
Gets the default number of line segments used to tessellate circles and ellipses in the debug draw system.
Declaration
public int DebugDrawDefaultSegments { get; }
Property Value
| Type | Description |
|---|---|
| int |
DebugDrawDefaultThickness
Gets the default line thickness in world units for world-space debug drawing.
Declaration
public float DebugDrawDefaultThickness { get; }
Property Value
| Type | Description |
|---|---|
| float |
DebugDrawMaxCommands
Gets the maximum number of draw commands that may be queued per frame by the debug draw system. When exceeded, additional commands are silently dropped.
Declaration
public int DebugDrawMaxCommands { get; }
Property Value
| Type | Description |
|---|---|
| int |
DebugDrawMeshPoolCapacity
Gets the initial capacity of the mesh pool used by the debug draw system.
Declaration
public int DebugDrawMeshPoolCapacity { get; }
Property Value
| Type | Description |
|---|---|
| int |
DebugDrawMeshPoolMaxSize
Gets the maximum number of meshes the debug draw pool will retain.
Declaration
public int DebugDrawMeshPoolMaxSize { get; }
Property Value
| Type | Description |
|---|---|
| int |
InitializationDelay
Gets the number of seconds ScyllaBootstrap waits between its own
Awake() call and the invocation of framework initialization.
This delay exists to guarantee that all ScyllaModule components
in the scene have had time to run their Awake() registration logic before
the module manager resolves dependencies and starts modules. A value that is too low
(below Scylla.Core.Config.ScyllaCoreConfiguration.LOW_DELAY_THRESHOLD) risks modules not yet being registered;
a value that is too high (above Scylla.Core.Config.ScyllaCoreConfiguration.HIGH_DELAY_THRESHOLD) makes the
application feel sluggish at launch.
Declaration
public float InitializationDelay { get; }
Property Value
| Type | Description |
|---|---|
| float | A float in the range [MIN_INIT_DELAY, MAX_INIT_DELAY] (seconds). Defaults to DEFAULT_INIT_DELAY (1.0 s). |
Methods
Apply()
Applies this configuration to the runtime system.
This override is intentionally a no-op: InitializationDelay is consumed
once by ScyllaBootstrap during its Start() call and cannot be
meaningfully re-applied after the framework has already begun initializing. The global
config file switches are similarly consumed at startup by ConfigFileManager
and are not re-evaluated at runtime.
Declaration
public override void Apply()
Overrides
ApplyConfigFileOverrides(ConfigFile)
Applies overrides from a JSON ConfigFile to the fields of this configuration. Only the InitializationDelay field (stored under group GROUP_INITIALIZATION, key KEY_INITIALIZATION_DELAY) is eligible for override.
Declaration
public override int ApplyConfigFileOverrides(ConfigFile configFile)
Parameters
| Type | Name | Description |
|---|---|---|
| ConfigFile | configFile | The ConfigFile containing override values sourced from the JSON file on disk.
If |
Returns
| Type | Description |
|---|---|
| int | The number of fields successfully applied from the config file. Currently |
Overrides
Remarks
The global config file switches (ConfigFilesEnabledInDebugBuild, ConfigFilesEnabledInProductionBuild, CreateConfigFiles) are intentionally excluded from JSON overrides to prevent a circular dependency: these fields control whether config files are loaded in the first place. Allowing them to be overridden by a config file would mean the decision of whether to read config files could only be made after config files have already been read.
ExportToConfigFile()
Exports the current core configuration values to a ConfigFile for serialization to disk. Only fields eligible for JSON override are exported: currently only InitializationDelay under group GROUP_INITIALIZATION, key KEY_INITIALIZATION_DELAY.
The global config file switches are excluded from the export for the same reason they are excluded from ApplyConfigFileOverrides(ConfigFile): they must not be overridden by a config file, so exporting them would be misleading.
Declaration
public override ConfigFile ExportToConfigFile()
Returns
| Type | Description |
|---|---|
| ConfigFile | A new ConfigFile containing the exportable fields of the current configuration, ready to be written to the user documents or application folder by ConfigFileManager. |
Overrides
GetConfigFileName()
Returns the canonical filename of this configuration asset, used to resolve its location
within the Resources/Config/ folder and to derive the JSON config file base name
via GetConfigFileBaseName().
The name follows the "Scylla [Name] Configuration" convention: stripping the
"Scylla " prefix and " Configuration" suffix yields the base name
"Core", which is used as the JSON file identifier by ConfigFileManager.
Declaration
public override string GetConfigFileName()
Returns
| Type | Description |
|---|---|
| string | The string |
Overrides
IsConfigFilesEnabledForCurrentBuild()
Determines whether the JSON config file system is globally enabled for all Scylla
configurations based on the type of the currently running build.
Returns ConfigFilesEnabledInDebugBuild when Debug.isDebugBuild
is true (Unity Editor or Development Builds), or
ConfigFilesEnabledInProductionBuild in all other cases.
Declaration
public bool IsConfigFilesEnabledForCurrentBuild()
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Build type detection relies on UnityEngine.Debug.isDebugBuild, which returns
true for both the Unity Editor and player builds made with the "Development Build"
checkbox enabled. Standard release builds return false.
This method is called by ConfigFileManager during initialization (via Initialize(ScyllaCoreConfiguration)) to set its global enable state. It should not be confused with the per-configuration IsConfigFileEnabledForCurrentBuild() method, which checks the individual per-asset switches.
LoadDefault()
Loads the default core configuration asset from the Unity Resources folder.
The asset is expected at the path Resources/Config/Scylla Core Configuration,
constructed by combining CONFIG_FOLDER with
CONFIG_FILENAME via FilePathUtil.Combine.
Declaration
public static ScyllaCoreConfiguration LoadDefault()
Returns
| Type | Description |
|---|---|
| ScyllaCoreConfiguration | The ScyllaCoreConfiguration asset found at the Resources path, or
|
ResetToDefaults()
Resets all configuration values to their built-in defaults:
- InitializationDelay -> DEFAULT_INIT_DELAY (1.0 s)
- ConfigFilesEnabledInDebugBuild ->
false - ConfigFilesEnabledInProductionBuild ->
false - CreateConfigFiles ->
false
Declaration
public override void ResetToDefaults()
Overrides
Validate()
Validates the core configuration and returns any issues found.
The following checks are performed on InitializationDelay:
- Error - value is below MIN_INIT_DELAY (negative delay).
- Warning - value is below Scylla.Core.Config.ScyllaCoreConfiguration.LOW_DELAY_THRESHOLD (0.05 s): modules may not have enough time to register before the framework initializes.
- Error - value exceeds MAX_INIT_DELAY (5 s).
- Warning - value exceeds Scylla.Core.Config.ScyllaCoreConfiguration.HIGH_DELAY_THRESHOLD (1 s): framework startup may feel slow to the user.
An empty array indicates that validation passed with no issues.
Declaration
public override ConfigurationValidationResult[] Validate()
Returns
| Type | Description |
|---|---|
| ConfigurationValidationResult[] | An array of ConfigurationValidationResult entries describing any problems found. Returns an empty array when the configuration is valid. |