Sandbox Logo

About Project Settings


A self initializing singleton for GameResources, this is useful for having project wide settings. It also comes with a custom dockable editor window that gives easy access to all project settings.

Code Example

[GameResource("Game Settings", "gs", "Game Settings")]
public class GameSettings : ProjectSetting<GameSettings>
{
[Group("Spawning"), Property] public int maxSpawns { get; set; } = 15;
[Group("Spawning"), Property] public Curve spawnRateCurve { get; set; }
[Group("Scenes"), Property] public SceneFile menuSceneFile { get; set; } }

[Button("Log Max Spawns")]
public void LogMaxSpawns()
{
    var maxSpawns = GameSettings.instance.maxSpawns;
     Log.Info($"maxSpawns: {maxSpawns}");
}


Add [ProjectSettingsWidget] to a class deriving from Widget and it'll show up in the ProjectSettings dockable window

Project Settings

Singleton based GameResources that have a custom dockable window for easy access!

Created
9/5/2024
Updated
9/7/2024
In Collections
Referenced By
Dependencies
Reviews