mcpField
U
unity-visitor-pattern

unity-visitor-pattern

github.com/muharremtozanDevelopment1749 installsUpdated 22w ago
Repository

About unity-visitor-pattern

A Unity-focused skill for implementing the Visitor pattern across component types, with double dispatch and Inspector-configurable ScriptableObject visitors. It is intended for developers who want shared modification logic without coupling that logic to core components.

Key features

  1. 01Double-dispatch type handling
  2. 02Inspector-configurable ScriptableObject visitors
  3. 03Decoupled component logic

Use cases

  1. 01Apply shared changes across different component types
  2. 02Implement PowerUp stat modifications

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/muharremtozan/unity-agent-skills --skill unity-visitor-pattern

After installing, type/unity-visitor-patternin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/code/
ScriptableVisitor.cs.txt
VisitorCore.cs.txt
VisitorExample.cs.txt
references/
guide.md

Details

From the project README

Unity Visitor Pattern

This skill provides a modular implementation of the Visitor pattern, specifically optimized for Unity systems where multiple component types need shared modification logic (e.g., PowerUps).

Core Features

  1. Double Dispatch: Safe and structured way to handle operations on multiple types.
  2. Scriptable Visitors: Data-driven logic providers that can be easily configured in the Inspector.
  3. Decoupled Logic: Keep your core components clean of "logic leakage" from external systems.

Core Files (Max 3)

  • VisitorCore.cs.txt: Base interfaces and visitable component base.
  • ScriptableVisitor.cs.txt: Pro-path ScriptableObject implementation.
  • VisitorExample.cs.txt: Concrete example for stat modification.

Usage

Refer to guide.md for implementation details and Pro/Light path distinctions.

Comments

Markdown supported