unity-scriptableobjects
Skill1.3k starsChanged 4 months agoApache-2.0View on GitHub
Architect Unity 6.3 LTS data and decoupling with ScriptableObjects: config/data assets, shared runtime variables, event channels, and runtime sets/registries. Use when designing data-driven systems, replacing singletons/managers, creating .asset data with CreateAssetMenu, or when the user mentions ScriptableObject, SO architecture, or data assets.
Trending
Quiet since October.thin dataabout the whole repository
Who's talking about gamedev-skills/awesome-gamedev-agent-skills
- M4jor-Tom/claude-game-dev“chore(deps): bump vendor/awesome-gamedev-agent-skills from `9ca5296` to `d4b0e35`”GitHub · Oct 5, 2026
- sudosubin/agents.nix“agent-skills.github.gamedev-skills.awesome-gamedev-agent-skills: init at 1.1.0”GitHub · Oct 3, 2026
- M4jor-Tom/claude-game-dev“build(deps): bump vendor/awesome-gamedev-agent-skills from `9ca5296` to `e86bec9`”GitHub · Sep 28, 2026
- AgentsLoop/OhMyGithub“Sky Courier airplane game with verified subagent critique loop /oc”GitHub · Aug 25, 2026
- AgentsLoop/OhMyGithub“OpenCode: ## Request”GitHub · Aug 25, 2026
The biggest 5 of 11 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 11
Talked about on GitHub (11 times).
On GitHub · 11
- Oct 5, 2026chore(deps): bump vendor/awesome-gamedev-agent-skills from `9ca5296` to `d4b0e35` — M4jor-Tom/claude-game-dev0 reactions
- Oct 3, 2026agent-skills.github.gamedev-skills.awesome-gamedev-agent-skills: init at 1.1.0 — sudosubin/agents.nix0 reactions
- Sep 28, 2026build(deps): bump vendor/awesome-gamedev-agent-skills from `9ca5296` to `e86bec9` — M4jor-Tom/claude-game-dev0 reactions · 1 comment
- Aug 25, 2026Sky Courier airplane game with verified subagent critique loop /oc — AgentsLoop/OhMyGithub0 reactions · 4 comments
- Aug 25, 2026OpenCode: ## Request — AgentsLoop/OhMyGithub0 reactions
6 more on GitHub
- Aug 25, 2026Airplane sky game with clouds and checkpoints /oc — AgentsLoop/OhMyGithub0 reactions · 8 comments
- Aug 5, 2026技能侦察 DIGEST 2026-08-05 16:00Z:+8 剩余类型包与 omer 精选 — NyphSan/CursorSkill0 reactions
- Aug 5, 2026技能侦察 DIGEST 2026-08-05 13:00Z:+8 CMC/网络/Niagara/编辑器/物理·性能·着色·输入 — NyphSan/CursorSkill0 reactions
- Aug 5, 2026技能侦察 DIGEST 2026-08-05 12:00Z:+8 Physics/Features/Data/Actor/Camera/Save/Procgen/Feel — NyphSan/CursorSkill0 reactions
- Aug 5, 2026技能侦察 DIGEST 2026-08-05 10:00Z:+8 Mover/BT/Input/Packaging/Mass/StateTree/Sequencer/Modeling — NyphSan/CursorSkill0 reactions
- Jul 7, 2026Audit candidate: gamedev-skills/awesome-gamedev-agent-skills — xiaolai/nlpm0 reactions · 3 comments
In this repository74 other files it gives its agents.
- routerSkill
- ai-behavior-trees-utility-aiSkill
- audio-designSkill
- camera-systemsSkill
- create-game-assetsSkill
- dialogue-systemsSkill
- game-aiSkill
- game-feelSkill
- game-ui-uxSkill
- input-systemsSkill
- level-designSkill
- performance-optimizationSkill
- physics-tuningSkill
- procedural-genSkill
- save-systemsSkill
- shader-programmingSkill
- card-gameSkill
- fps-shooterSkill
- platformerSkill
- puzzleSkill
- roguelikeSkill
- rpgSkill
- survival-craftingSkill
- tower-defenseSkill
- visual-novelSkill
- godot-2d-movementSkill
- godot-3d-essentialsSkill
- godot-animationSkill
- godot-audioSkill
- godot-csharpSkill
- godot-exportSkill
- godot-gdscript-headless-testingSkill
- godot-gdscriptSkill
- godot-multiplayerSkill
- godot-nodes-scenesSkill
- godot-physicsSkill
- godot-resourcesSkill
- godot-shadersSkill
- godot-signals-groupsSkill
- godot-tilemapSkill
- godot-ui-controlSkill
- bevy-ecsSkill
- love2d-coreSkill
- pygame-coreSkill
- roblox-charactersSkill
- roblox-datastoresSkill
- roblox-luauSkill
- roblox-networkingSkill
- roblox-physicsSkill
- roblox-studio-workflowSkill
- roblox-uiSkill
- unity-animationSkill
- unity-build-pipelineSkill
- unity-csharp-scriptingSkill
- unity-input-systemSkill
- unity-navmeshSkill
- unity-physicsSkill
- unity-tilemap-2dSkill
- unreal-behavior-treesSkill
- unreal-blueprintsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Use ScriptableObject assets to store shared data and decouple systems in Unity 6.3 LTS — configuration, event channels, and registries that …
- Very specific: line 18
Use when you need designer-editable config (weapon stats, level data), to share one value between unrelated systems, to decouple senders …
- Very specific: line 21
Use when the project has *.asset data files backed by : ScriptableObject classes.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unity ScriptableObject Architecture
Use ScriptableObject assets to store shared data and decouple systems in Unity 6.3 LTS —
configuration, event channels, and registries that live as project assets instead of being
hard-wired into scenes or singletons. Targets Unity 6.3 LTS (6000.3).
When to use
- Use when you need designer-editable config (weapon stats, level data), to share one value
between unrelated systems, to decouple senders from listeners via event channels, or to
build a runtime registry of active objects — without a
static/singleton manager. - Use when the project has
*.assetdata files backed by: ScriptableObjectclasses.
When not to use: per-instance runtime state that differs per GameObject (that belongs on
a MonoBehaviour) — a ScriptableObject asset is shared by everyone who references it. Saving
player progress to disk → save-systems. Plain DTOs that never need to be an asset can just be
[System.Serializable] classes.
Core workflow
- Define the class deriving from
ScriptableObjectand tag it with[CreateAssetMenu]so designers can create instances from the Assets menu. - Create one or more
.assetinstances in the Project window; each is a shared, named piece of data referenced by[SerializeField]fields. - Reference, don't copy. MonoBehaviours hold a reference to the asset; they all see the same data, so changing the asset changes every consumer.
- For decoupling, model signals and shared variables as ScriptableObjects: a "FloatVariable" the HUD reads and the player writes; an "event channel" the player raises and many systems listen to. Neither side references the other.
- Reset runtime mutations in
OnEnableif the asset is mutated during play, because edits made in the Editor at runtime persist on the asset (a frequent source of "my values changed after I played"). - Verify by inspecting the asset values during Play mode and confirming consumers react.
Patterns
1. Config/data asset
using UnityEngine;
[CreateAssetMenu(fileName = "WeaponData", menuName = "Game/Weapon Data", order = 0)]
public class WeaponData : ScriptableObject
{
public string displayName = "Pistol";
public int damage = 10;
public float fireRate = 0.25f;
public GameObject projectilePrefab;
}public class Weapon : MonoBehaviour
{
[SerializeField] private WeaponData data; // assign the shared asset in the Inspector
private void Fire() => Debug.Log($"{data.displayName} for {data.damage}");
}2. Shared runtime variable (decouples producer from consumer)
[CreateAssetMenu(menuName = "Game/Float Variable")]
public class FloatVariable : ScriptableObject
{
[SerializeField] private float initialValue;
[System.NonSerialized] public float runtimeValue; // not saved to the asset
private void OnEnable() => runtimeValue = initialValue; // reset each play session
}
// Player writes playerHealth.runtimeValue; the HUD reads it — neither references the other.3. Creating an instance at runtime (not an asset on disk)
// For transient SO data you build in code (e.g. a generated config).
var temp = ScriptableObject.CreateInstance<WeaponData>();
temp.damage = 25;
// ...use temp... Destroy(temp); // clean up runtime-created instancesPitfalls
- Editing an SO at runtime persists in the Editor — values you change during Play stay
changed on the asset after you stop. Keep mutable runtime state in
[NonSerialized]fields reset inOnEnable, or it will surprise you. (In a build, asset edits do not persist across launches.) - Disabled Domain Reload skips your
OnEnablereset — with Enter Play Mode Options enabled and Reload Domain off (a Unity 6.3 LTS fast-iteration setting), already-loaded SOs are not re-created when you press Play, soOnEnablenever fires andruntimeValuekeeps its value from the previous session. Reset explicitly from anISerializationCallbackReceiveror a scene-load hook instead of relying onOnEnablealone. - Expecting per-object state — every reference points to the same asset. If two enemies need different current HP, store HP on the MonoBehaviour, not the shared SO.
- No frame lifecycle — ScriptableObjects have
OnEnable/OnDisable/OnDestroybut noUpdate. Don't expect per-frame callbacks. - Using SOs as a save file — they're authoring assets, not runtime persistence; write
progress with
save-systemsinstead. - Leaking
CreateInstanceobjects — runtime-created instances are not garbage-collected like plain C# objects;Destroythem when done.
References
- For the event-channel pattern (a
GameEventSO + listeners, type-safe payloads) and runtime sets/registries (a shared list of active enemies), readreferences/event-channels.md. - Primary docs: Unity Manual "ScriptableObject" (
/Manual/class-ScriptableObject.html) andScriptReference/ScriptableObject,ScriptReference/CreateAssetMenuAttribute.
Related skills
unity-csharp-scripting— the MonoBehaviours that consume these assets.save-systems— persisting state to disk (what SOs are not for).card-game/rpg/survival-crafting— genres that lean on SO-driven data.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

