Unity 6.3 LTS data and decoupling with ScriptableObjects: CreateAssetMenu config assets, shared runtime variables, event channels and .asset files made from code. Use for replacing singletons, data-driven items or cards, or values that persist after leaving Play mode. Not for saving progress (`save-systems`) or Godot Resources (`godot-resources`).
Ships in gamedev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use ScriptableObject assets in Unity 6.3 LTS (6000.3) for shared data and for decoupling
systems: configuration, event channels and registries that live as project assets instead of
scene singletons. An SO asset is a YAML file you can read and check without the Editor.
*.asset files backed by : ScriptableObject classes.When not to use: state that differs per GameObject belongs on a MonoBehaviour, since an SO
asset is shared by everyone who references it; saving progress → save-systems; plain data
that never needs to be an asset can be a [System.Serializable] class.
ScriptableObject, in a file with the same name, with
[CreateAssetMenu] so designers can create instances..asset and its .meta with a valid GUID. Do not
hand-write a new .asset file: the m_Script GUID must match the script's .meta.[SerializeField] reference; every
consumer sees the same data.[System.NonSerialized]) and
reset it when Play mode starts (pattern 2), because Play-mode edits to an asset persist in
the Editor.Resources folder or from Addressables ship in the
player.using UnityEngine;
[CreateAssetMenu(fileName = "WeaponData", menuName = "Game/Weapon Data")]
public class WeaponData : ScriptableObject
{
public string displayName = "Pistol";
public int damage = 10;
public float fireRate = 0.25f;
public GameObject projectilePrefab;
}
using UnityEngine;
[CreateAssetMenu(menuName = "Game/Float Variable")]
public class FloatVariable : ScriptableObject
{
[SerializeField] private float initialValue;
[System.NonSerialized] public float runtimeValue; // never saved to the asset
private void OnEnable()
{
runtimeValue = initialValue;
#if UNITY_EDITOR
// With Reload Domain off, OnEnable does not run again on Play, so also reset there.
UnityEditor.EditorApplication.playModeStateChanged -= ResetOnPlay;
UnityEditor.EditorApplication.playModeStateChanged += ResetOnPlay;
#endif
}
#if UNITY_EDITOR
private void OnDisable() => UnityEditor.EditorApplication.playModeStateChanged -= ResetOnPlay;
private void ResetOnPlay(UnityEditor.PlayModeStateChange change)
{
if (change == UnityEditor.PlayModeStateChange.ExitingEditMode) runtimeValue = initialValue;
}
#endif
}
Put this in an Editor folder. Run it from the menu, from the Unity CLI with
unity command script eval --code 'WeaponAssets.CreateDefaults();', or in batch mode with
-executeMethod WeaponAssets.CreateDefaults.
using UnityEditor;
using UnityEngine;
public static class WeaponAssets
{
[MenuItem("Tools/Create Default Weapons")]
public static void CreateDefaults()
{
if (!AssetDatabase.IsValidFolder("Assets/Data"))
AssetDatabase.CreateFolder("Assets", "Data");
var pistol = ScriptableObject.CreateInstance<WeaponData>();
pistol.displayName = "Pistol";
pistol.damage = 10;
AssetDatabase.CreateAsset(pistol, "Assets/Data/Pistol.asset"); // writes .asset and .meta
AssetDatabase.SaveAssets();
}
}
To change an existing asset from editor code, load it with
AssetDatabase.LoadAssetAtPath<WeaponData>(path), set the fields, call
EditorUtility.SetDirty(asset) and then AssetDatabase.SaveAssets(); without SetDirty the
change is lost on the next reload.
.asset has a MonoBehaviour: document
with m_Script: {fileID: 11500000, guid: ..., type: 3}, m_Name, and one line per
serialized field (damage: 10). Grep the values, and run unity-csharp-scripting's
check_unity_project.py to confirm every m_Script GUID resolves to a script.unity command script eval --code 'return AssetDatabase.LoadAssetAtPath<WeaponData>("Assets/Data/Pistol.asset").damage;'AssetDatabase.LoadAssetAtPath and
assert its values, or exercise an event channel with ScriptableObject.CreateInstance
(setup in unity-csharp-scripting).[NonSerialized] fields and
reset it.OnEnable reset stopped working. With Enter Play Mode Options on and Reload Domain
off, loaded SOs are not recreated on Play, so OnEnable does not run. Also reset on
EditorApplication.playModeStateChanged (pattern 2) or from a static
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] method.[UnityEngine.Serialization.FormerlySerializedAs("oldName")] when you rename..meta GUID changed.Resources or Addressables.Update. SOs get OnEnable, OnDisable, OnDestroy and OnValidate, not frame
callbacks.CreateInstance objects. Runtime-created instances are Unity objects; Destroy
them when done.references/event-channels.md when adding an event channel (a GameEvent SO with
listeners, typed payloads) or a runtime set that replaces FindObjectsByType scans.unity-csharp-scripting: the MonoBehaviours that use these assets, tests and the .meta
checker.save-systems: writing progress to disk.card-game, rpg, survival-crafting: genres built on SO data.Last verified: 2026-11-11, against Unity 6000.3.28f1.
ScriptableObject,
CreateAssetMenuAttribute, AssetDatabase.CreateAsset, EditorUtility.SetDirty,
Serialization.FormerlySerializedAsAttribute.script eval is a com.unity.pipeline 1.0.0-pre.1 command (pre-release):
https://docs.unity3d.com/Packages/[email protected]/manual/index.htmlWhat SKILL.md sets; muted values are Claude Code's defaults
/gamedev:unity-scriptableobjectsfrom gamedev
npx claudepluginhub cirobarone78/games-skill --plugin gamedev80 skills in this plugin
/ai-behavior-trees-utility-aiEngine-neutral behavior tree and utility AI code for NPCs in any language: Blackboard, reactive composites, decorators and response-curve scoring. Use when an enemy keeps chasing after losing sight, restarts its action every frame or flip-flops between choices. Not for FSMs, steering or pathfinding (`game-ai`) or Unreal BT, EQS and StateTree (`unreal-behavior-trees`).
/audio-designEngine-neutral game audio technique: bus layout, volume sliders in decibels, loudness, ducking music under dialogue, adaptive music and SFX variation, with Godot, Unity and FMOD/Wwise mappings. Use when mixing a game, making music react to combat, fixing repetitive footsteps or beat sync, or a mix that clips or pumps. Not for the Godot audio API (`godot-audio`).
/