Class UserProjectSettings

The UserProjectSettings managed per-user project settings. The settings are cloud synchronized and potentially accessible by other users. Sensitive data should not be stored unencrypted in the settings.

To create custom, cloud-persisted and user settings. Use APIs such as UserProjectSettings.setString and UserProjectSettings.setObject. Once the setting has changed, invoke UserProjectSettings.save.

Constructors

Properties

The built-in editor specific user settings.

To create custom, cloud-persisted and shared project settings. Use APIs such as UserProjectSettings.setString and UserProjectSettings.setObject. Once the setting was changed, invoke UserProjectSettings.save to persist the changes. The settings are cloud synchronized, make sure to minimize changes to avoid conflicts for other users.

settingsCreatedDuringLoad

An unsynchronized field that is used as a marker to determine if the settings were created during sync.

Methods

  • Deletes all key/value pairs.

    Returns void

  • Deletes a key with the specified name.

    Parameters

    • name: string

    Returns void

  • Returns true if the key with the specified name exists.

    Parameters

    • name: string

    Returns boolean

  • Gets the BigInt value of the specified key, or the defaultValue if the key cannot be found.

    Parameters

    • key: string
    • defaultValue: bigint

    Returns bigint

  • Gets the boolean value of the specified key, or the defaultValue if the key cannot be found.

    Parameters

    • key: string
    • defaultValue: boolean

    Returns boolean

  • Gets the number value of the specified key, or the defaultValue if the key cannot be found.

    Parameters

    • key: string
    • defaultValue: number

    Returns number

  • Gets the object value of the specified key, or the defaultValue if the key cannot be found. If no defaultValue is specified, a default constructed instance will be returned.

    Type Parameters

    • T

    Parameters

    • type: ClassOf<T>

      The type of the object.

    • name: string

      Name of the property to retrieve.

    • OptionaldefaultValue: T

      The optional default value.

    Returns T

    Value of the property if it exists and matches the type, the defaultValue or a default constructed instance.

  • Gets the string value of the specified key, or the defaultValue if the key cannot be found.

    Parameters

    • key: string
    • defaultValue: string

    Returns string

  • Loads the specified user resource.

    Parameters

    Returns void

  • Marks the settings dirty and will enable auto saving. The resource will automatically save after one second, if further changes occur the resource save will be delayed by another second.

    Parameters

    • justification: string

    Returns void

  • Returns void

  • Resets all settings to defaults.

    Returns void

  • Saves the project settings to disk.

    Parameters

    • asynchronous: boolean

    Returns void

    Prefer markDirtyForAutoSave to allow multiple changes to occur before saving to avoid frequent saves and version changes.

  • Sets the BigInt value for the specified key.

    Parameters

    • key: string
    • value: bigint

    Returns void

  • Sets the boolean value for the specified key.

    Parameters

    • key: string
    • value: boolean

    Returns void

  • Sets the number value for the specified key.

    Parameters

    • key: string
    • value: number

    Returns void

  • Sets the object value for the specified key.

    Type Parameters

    • T extends Object

    Parameters

    • name: string
    • value: T

    Returns void

    Any object marked with serializedObject decorator can be provided, excluding built-in types such as Component and Resource.

  • Sets the string value for the specified key.

    Parameters

    • key: string
    • value: string

    Returns void

Events

onLoaded: Event<[], void>

Invoked when the settings have been loaded.

onUnload: Event<[], void>

Invoked when the settings are being unloaded.

onSaved: Event<[], void>

Invoked when the settings have been saved.

onEditorUserModeChanged: Event<[EnumValue<EditorUserMode, number>], void>

Invoked when the editorUserMode property changed.

onSettingsChanged: Event<[ClassOf<EditorSettingsType>, EditorSettingsType], void>

Invoked when settings changed.