MuharremTozan/Agentic-Duel / .agent/skills/unity-memento-pattern
unity-memento-pattern
VerifiedImplements the Memento pattern for capturing and restoring object states. Perfect for Loadout managers, Checkpoints, and Undo/Redo systems.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 1.1 KB |
| assets/code/HotbarMementoExample.cs.txt | markdown | 1.1 KB |
| assets/code/IMemento.cs.txt | markdown | 634 B |
| assets/code/LoadoutManager.cs.txt | markdown | 1.1 KB |
| references/guide.md | markdown | 1.2 KB |
SKILL.md
View on GitHub---
name: unity-memento-pattern
description: Implements the Memento pattern for capturing and restoring object states. Perfect for Loadout managers, Checkpoints, and Undo/Redo systems.
---
# Unity Memento Pattern
This skill provides a structured way to handle state snapshots in Unity. Inspired by Adam Myhre's implementation, it strictly separates state data (Memento), the state producer (Originator), and the state manager (Caretaker).
## Core Features
1. **Immutable Snapshots**: Ensures saved data cannot be corrupted by subsequent changes to the original object.
2. **Loadout Management**: Built-in support for multiple save slots (Caretaker logic).
3. **Encapsulation**: State structure is hidden from the resting system, exposing only what is necessary.
## Core Files (Max 3)
- `IMemento.cs.txt`: Base interfaces and generic Memento wrapper.
- `LoadoutManager.cs.txt`: Caretaker implementation for managing list-based snapshots.
- `HotbarMementoExample.cs.txt`: Practical application for UI/Item state persistence.
## Usage
Refer to `HotbarMementoExample.cs.txt` to see how to save a list of ScriptableObjects using a copy-constructor.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |