Skip to main content

Settings Reference

This page documents all configurable settings in DialogueCraft, covering the DialogueCraftSettings ScriptableObject, its public API, and the editor preferences stored via EditorPrefs.


DialogueCraftSettings

DialogueCraftSettings is a ScriptableObject singleton located at Assets/Resources/DialogueCraftSettings.asset. It is loaded automatically via Resources.Load at runtime and in the editor. If the asset does not exist, the editor creates one automatically on first access.

Class: DialogueCraft.DialogueCraftSettings Source: Runtime/Data/DialogueCraftSettings.cs


Database References

These fields link the project-wide databases that DialogueCraft uses for characters, variables, and localization.

FieldTypeDefaultDescription
characterDatabaseCharacterDatabasenullThe character database for this project. All dialogues reference characters from this asset.
variableDatabaseVariableDatabasenullThe variable database for this project. Stores global variable definitions used in conditions and state tracking.
localizationDatabaseLocalizationDatabasenullThe localization database for this project. Contains all translatable text entries.

Localization Settings

FieldTypeDefaultDescription
localizationProviderLocalizationProviderTypeBuiltInWhich localization backend to use. See values below.

LocalizationProviderType values:

ValueDescription
BuiltIn (0)DialogueCraft's own localization system with CSV import/export. Works standalone with no additional packages.
LocalizeCraft (1)LocalizeCraft integration. Provides AI-powered translation and a shared database with a dedicated UI. Requires the LocalizeCraft package.
UnityLocalization (2)Unity's official localization package (com.unity.localization). Delegates to Unity's localization tables.

Audio Settings

FieldTypeDefaultDescription
audioSourceAudioSourceTypeUnityThe audio backend for the entire project. Applies globally to voice lines, sound effects, and typewriter sounds.

AudioSourceType values:

ValueDescription
UnityUse AudioClip assets and Unity's built-in audio system.
FMODUse FMOD Studio event paths for playback. Requires com.fmod.studio 2.02 or later. FMOD support is auto-detected via asmdef version defines (DIALOGUECRAFT_FMOD).

Dialogue Defaults

FieldTypeDefaultRangeDescription
defaultTypingSpeedfloat0.050.01 -- 0.2Default typing speed in seconds per character for the typewriter effect.
autoSavebooltrue--Whether to auto-save dialogue assets when they are modified in the editor.

Default Typewriter Sound (Unity Audio)

These fields define the project-wide default typewriter sound configuration when using Unity's audio backend. Individual characters can override these values on their CharacterData asset.

FieldTypeDefaultRangeDescription
defaultTypewriterModeTypewriterModeSingle--How typewriter sounds are selected. See values below.
defaultTypewriterSoundAudioClipnull--The sound clip used in Single mode.
defaultTypewriterSoundsAudioClip[]null--Pool of sound clips for Random mode. One is picked randomly per character typed.
defaultVowelSoundsAudioClip[]null--Sound clips for vowels (a, e, i, o, u) in VowelConsonant mode.
defaultConsonantSoundsAudioClip[]null--Sound clips for consonants in VowelConsonant mode.
defaultLetterSoundsAudioClip[26]new[26]--Per-letter sound mapping for PerLetter mode. Index 0 = a, 1 = b, through 25 = z.
defaultTypewriterPitchfloat1.00.5 -- 2.0Base pitch for typewriter sound playback. 1.0 is normal pitch.
defaultTypewriterPitchVariationfloat0.050.0 -- 0.3Random pitch variation range applied on each character typed.
defaultTypewriterVolumefloat1.00.0 -- 1.0Volume for typewriter sound playback.

TypewriterMode values:

ValueDescription
SingleOne sound clip with pitch variation applied per character.
RandomPicks randomly from a pool of sound clips. Useful for keyboard click effects.
VowelConsonantUses different sound pools for vowels versus consonants.
PerLetterA unique sound per letter a through z. Produces an Animal Crossing-style voice effect.

Default Typewriter Sound (FMOD)

These fields mirror the Unity audio typewriter settings but use FMOD event paths instead of AudioClip references. They are only relevant when audioSource is set to FMOD.

FieldTypeDefaultDescription
defaultTypewriterFmodEventPathstring""FMOD event path for Single mode.
defaultTypewriterFmodEventPathsstring[]nullFMOD event paths for Random mode.
defaultTypewriterFmodVowelPathsstring[]nullFMOD event paths for vowel sounds in VowelConsonant mode.
defaultTypewriterFmodConsonantPathsstring[]nullFMOD event paths for consonant sounds in VowelConsonant mode.
defaultTypewriterFmodLetterPathsstring[26]new[26]FMOD event paths per letter a through z for PerLetter mode.

Editor Preferences (on the ScriptableObject)

FieldTypeDefaultDescription
showInspectorbooltrueWhether the inspector panel is visible in the dialogue editor by default.

Accessing Settings from Code

Singleton Access

The settings instance is accessed through the static Instance property. It loads the asset from Resources/DialogueCraftSettings on first access and caches the result. In the editor, if no asset exists, one is created automatically at Assets/Resources/DialogueCraftSettings.asset.

DialogueCraftSettings settings = DialogueCraftSettings.Instance;

float speed = settings.defaultTypingSpeed;
AudioSourceType backend = settings.audioSource;

Static Convenience Properties

Three static properties provide shorthand access to the database references. Each returns null if the settings asset or the referenced database is not assigned.

PropertyReturn TypeDescription
DialogueCraftSettings.CharactersCharacterDatabaseShorthand for Instance.characterDatabase.
DialogueCraftSettings.VariablesVariableDatabaseShorthand for Instance.variableDatabase.
DialogueCraftSettings.LocalizationLocalizationDatabaseShorthand for Instance.localizationDatabase.
CharacterDatabase chars = DialogueCraftSettings.Characters;
VariableDatabase vars = DialogueCraftSettings.Variables;
LocalizationDatabase loc = DialogueCraftSettings.Localization;

Creating Default Databases (Editor Only)

The CreateDefaultDatabases() method is available in the editor (#if UNITY_EDITOR). It checks each database reference on the settings asset and, for any that are null, creates a new default asset under Assets/DialogueCraft/ and assigns it. This method is useful for first-time project setup.

#if UNITY_EDITOR
DialogueCraftSettings.Instance.CreateDefaultDatabases();
#endif

The method creates the following assets when their corresponding field is null:

  • Assets/DialogueCraft/Characters.asset (assigned to characterDatabase)
  • Assets/DialogueCraft/Variables.asset (assigned to variableDatabase)
  • Assets/DialogueCraft/Localization.asset (assigned to localizationDatabase)

Editor Preferences (EditorPrefs)

The dialogue editor window persists layout and UI state using Unity's EditorPrefs. These values are stored per-machine and are not committed to version control.

Panel Visibility

KeyTypeDefaultDescription
DialogueCraft_ShowInspectorbooltrueWhether the node inspector panel is visible in the Dialogue tab.
DialogueCraft_ShowPreviewboolfalseWhether the dialogue preview panel is visible.
DialogueCraft_ShowValidationboolfalseWhether the validation panel is visible.

Panel Sizing

KeyTypeDefaultDescription
DialogueCraft_InspectorWidthfloat300Width in pixels of the inspector side panel.
DialogueCraft_PreviewWidthfloat350Width in pixels of the preview side panel.
KeyTypeDefaultDescription
DialogueCraft_ActiveTabint0Index of the last active tab. Maps to: 0 = Dialogue, 1 = Characters, 2 = Variables, 3 = Localization, 4 = Settings.
DialogueCraft_LastDialoguestring""Asset path of the last opened dialogue. The editor re-opens this dialogue automatically on launch.
DialogueCraft_LastCreateFolderstring""The last folder path used when creating a new dialogue asset via the save dialog.

Filter State

KeyTypeDefaultDescription
DialogueCraft.Variables.TypeFiltersstring""Comma-separated list of active type filters in the Variables tab (e.g., "Int,Bool"). An empty string means no filters are active and all types are shown.