Skip to content

Game.EditorSettings

Assembly: Assembly-CSharp
Namespace: Game.Settings

Type: class

Base: Setting

Summary:
EditorSettings holds persistent editor-specific configuration for the game's editor UI and import behavior. It includes layout values (inspector/hierarchy widths), picker configuration (columns, favorites, search history), import options (parallel import, texture compression), last-used directories, and tutorial visibility state. The class is marked with [FileLocation("Editor")], indicating these settings are saved under the Editor settings file. Calling ResetTutorials clears the stored tutorial state and notifies the EditorTutorialSystem to reset the in-editor tutorials.


Fields

  • This class does not declare any explicit private fields in this file; all stored data is exposed through properties.

Properties

  • public int prefabPickerColumnCount { get; set; }
    Controls how many columns the prefab picker UI uses.

  • public string[] prefabPickerFavorites { get; set; }
    Array of prefab identifiers marked as favorites in the prefab picker.

  • public string[] prefabPickerSearchHistory { get; set; }
    Search history entries for the prefab picker.

  • public string[] prefabPickerSearchFavorites { get; set; }
    Favorite searches for the prefab picker.

  • public int assetPickerColumnCount { get; set; }
    Number of columns used by the asset picker UI.

  • public string[] assetPickerFavorites { get; set; }
    Array of favorite assets for the asset picker.

  • public string[] directoryPickerFavorites { get; set; }
    Array of favorite directories for directory pickers.

  • public int inspectorWidth { get; set; }
    Width in pixels of the inspector panel.

  • public int hierarchyWidth { get; set; }
    Width in pixels of the hierarchy panel.

  • public bool useParallelImport { get; set; }
    Enables or disables parallel import when importing assets.

  • public bool lowQualityTextureCompression { get; set; }
    If true, use lower-quality (but faster/smaller) texture compression during import.

  • public string lastSelectedProjectRootDirectory { get; set; }
    Last-used project root directory (for import/export dialogs).

  • public string lastSelectedImportDirectory { get; set; }
    Last-used import directory.

  • public bool showTutorials { get; set; }
    Global toggle whether tutorials should be shown.

  • public Dictionary<string, bool> shownTutorials { get; set; }
    Map of tutorial IDs to a flag indicating whether a tutorial has been shown.

  • public bool resetTutorials { set }
    Write-only property with UI attributes ([SettingsUIButton], [SettingsUIConfirmation]). Writing to this property invokes ResetTutorials(), clearing shownTutorials and propagating the reset to the EditorTutorialSystem. Intended for exposing a reset action in the settings UI.

Constructors

  • public EditorSettings()
    Initializes a new instance and calls SetDefaults() to populate default values.

Methods

  • public void ResetTutorials()
    Clears the shownTutorials dictionary, persists the change via ApplyAndSave() (inherited from Setting), and notifies the EditorTutorialSystem by calling World.DefaultGameObjectInjectionWorld.GetExistingSystemManaged().OnResetTutorials(). Use this to reset the tutorial state from code or via the settings UI.

  • public override void SetDefaults()
    Populates default values for all properties. Defaults set by this method include:

  • prefabPickerColumnCount = 1
  • prefabPickerFavorites = empty array
  • prefabPickerSearchHistory = empty array
  • prefabPickerSearchFavorites = empty array
  • assetPickerColumnCount = 4
  • assetPickerFavorites = empty array
  • directoryPickerFavorites = empty array
  • inspectorWidth = 450
  • hierarchyWidth = 350
  • lastSelectedProjectRootDirectory = null
  • lastSelectedImportDirectory = null
  • useParallelImport = true
  • lowQualityTextureCompression = false
  • showTutorials = false
  • shownTutorials = new Dictionary()

Usage Example

// Create settings, modify some values and save.
// Note: ApplyAndSave() is inherited from Setting.
var settings = new EditorSettings();
settings.inspectorWidth = 500;
settings.prefabPickerColumnCount = 2;
settings.prefabPickerFavorites = new string[] { "ResidentialSmall", "ParkSmall" };
settings.ApplyAndSave();

// Reset tutorials from code (also available via the settings UI button bound to resetTutorials)
settings.resetTutorials = true; // triggers ResetTutorials()

Additional notes: - The [FileLocation("Editor")] attribute indicates the settings are stored with the Editor settings group. - ResetTutorials not only clears the persisted tutorial flags but also calls EditorTutorialSystem.OnResetTutorials() to update runtime tutorial state. Ensure the default World (World.DefaultGameObjectInjectionWorld) and EditorTutorialSystem exist in the current context when invoking this.