unity-so-prefab-manager
Installation
SKILL.md
Unity SO-Prefab Manager
This skill enforces a strictly modular "Bridge" pattern between Data and Logic.
Core Workflow: The Bridge Pattern
To ensure that multiple instances of the same unit (e.g., 4 Robots) can have independent runtime values (Health, Energy) while sharing the same Template (RobotSO), follow these steps:
1. Structure the ScriptableObject (The Template)
The SO should contain Static/Read-Only data that defines the "Ideal" version of the object.
- Example:
maxHealth,baseSpeed,displayName.
2. Structure the MonoBehaviour (The Instance)
The script on the Prefab should contain Runtime/Mutable data and a reference to the SO.
- Example:
currentHealth,activeBuffs.
3. Initialize the Bridge
Use Awake() to copy values from the SO to the local instance variables.