unity-decorator-pattern
Installation
SKILL.md
Unity Decorator Pattern
Minimal decorator pattern for stat modification.
Core Features
- Generic Interface:
IDecorator<T>for any value type - Stat Modifiers: Percentage and flat modifications
- Composable: Stack multiple decorators
Core Files (1 file)
Decorator.cs.txt: Complete decorator pattern (interface + base + modifiers)
Usage
IDecorator<float> damage = new BaseStat(100);
damage = new PercentageModifier(damage, 0.2f); // +20%
damage = new FlatModifier(damage, 10); // +10
float final = damage.GetValue(); // 130