docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ProjectUserSettings

    Represents a settings repository that stores data local to a Unity project. The settings data is serialized to a JSON file.

    Inheritance
    object
    FileSettingsRepository
    ProjectUserSettings
    Implements
    ISettingsRepository
    Inherited Members
    FileSettingsRepository.k_PackageSettingsDirectory
    FileSettingsRepository.k_UserProjectSettingsDirectory
    FileSettingsRepository.scope
    FileSettingsRepository.path
    FileSettingsRepository.name
    FileSettingsRepository.TryLoadSavedJson(out string)
    FileSettingsRepository.Save()
    FileSettingsRepository.Set<T>(string, T)
    FileSettingsRepository.Get<T>(string, T)
    FileSettingsRepository.ContainsKey<T>(string)
    FileSettingsRepository.Remove<T>(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.SettingsManagement
    Assembly: Unity.Settings.Editor.dll
    Syntax
    [Serializable]
    public class ProjectUserSettings : FileSettingsRepository, ISettingsRepository

    Constructors

    ProjectUserSettings(string, string)

    Initializes and returns an instance of the ProjectUserSettings repository with the serialized data location set to a path defined by the specified package and name values relative to the UserSettings directory. For example: MyUnityProject/UserSettings/Packages/com.example.my-package/Settings.json.

    Declaration
    public ProjectUserSettings(string package, string name = "Settings")
    Parameters
    Type Name Description
    string package

    The name of the package to store the serialized data under.

    string name

    The base filename to use for the serialized data location (defaults to "Settings").

    Methods

    GetUserSettingsPath(string, string)

    Builds and returns a path for a settings file relative to the calling assembly's package directory. This method constructs the location from the specified package and (filename) name under the UserSettings folder.

    Declaration
    public static string GetUserSettingsPath(string package, string name)
    Parameters
    Type Name Description
    string package

    The name of the package requesting this setting.

    string name

    An optional name for the settings file. Default is "Settings."

    Returns
    Type Description
    string

    A package-scoped path to the settings file inside the project's UserSettings folder.

    Implements

    ISettingsRepository
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)