Skip to content
One Last Click Docs

How to Use?

Create a ScriptableObject and add the [ProjectSettings] attribute.

using OneLastClick.ProjectSettings;
using UnityEngine;
[ProjectSettings]
public class ExampleProjectSettings : ScriptableObject
{
[SerializeField] public int IntValue;
[SerializeField] public GameObject Prefab;
[SerializeField] public string Message = "Hello, World!";
}

The package automatically creates a corresponding entry under Edit → Project Settings.

Use ProjectSettingsDatabase.Get<T>() to access settings at runtime.

var settings = ProjectSettingsDatabase.Get<ExampleProjectSettings>();
Debug.Log(settings.Message);

Non-editor-only settings are automatically made available to the runtime and within builds, so no asset references or manual initialization are required.

Use ProjectSettingsEditorDatabase.GetOrCreateDefault<T>() to access settings from editor code.

var settings =
ProjectSettingsEditorDatabase.GetOrCreateDefault<ExampleProjectSettings>();
Debug.Log(settings.Message);

If the settings file does not exist, it is created automatically.

Changes made through editor code can be persisted using SaveProjectSetting().

var settings =
ProjectSettingsEditorDatabase.GetOrCreateDefault<ExampleProjectSettings>();
settings.IntValue = 42;
ProjectSettingsEditorDatabase.SaveProjectSetting(settings);

Settings that are only required by editor tooling can be marked with editorOnly.

[ProjectSettings(editorOnly: true)]
public class BuildProjectSettings : ScriptableObject
{
public string BuildOutputDirectory;
public bool EnableDevelopmentBuild;
}

Editor-only settings:

  • Are available through ProjectSettingsEditorDatabase.
  • Appear in Project Settings.
  • Are not included in runtime builds.
  • Cannot be accessed through ProjectSettingsDatabase.Get<T>().