unity-event

Manage UnityEvent persistent listeners on GameObjects and components.

8|1|Updated Oct 7, 2025
One-click install
npx skills add https://github.com/Zzulin/unity-project01 --skill unity-event-zzulin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-event
Source: https://github.com/Zzulin/unity-project01/tree/main/URP1/Plugins/Unity-Skills-main/SkillsForUnity/unity-skills~/skills/event
Command: npx skills add https://github.com/Zzulin/unity-project01 --skill unity-event-zzulin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies managing UnityEvent persistent listeners across GameObjects and components, removing the manual, error-prone process of inspecting, adding, and removing editor-time callbacks for UI and other event-driven systems.

Core Features & Use Cases

  • Inspect persistent listeners on UnityEvents (for example, view all targets on a Button.onClick).
  • Add, remove, clear, copy, and batch-add persistent listeners, and update listener call states or retrieve listener counts for automation or bulk UI fixes.
  • Use Case: When a UI designer needs to replace or audit onClick handlers across multiple buttons, use the listing and batch-add/ copy features to migrate listeners reliably.

Quick Start

Add a persistent onClick listener to the PlayButton's Button component so it calls AudioManager.Play at edit time.

Frequently Asked Questions about unity-event

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a persistent listener to a Unity Button onClick event?

To add a persistent listener to a Unity Button onClick event, you specify the target GameObject and the exact component method name. This allows editor-time configuration of UnityEvent callbacks without manual inspector interactions.

Can I copy UnityEvent listeners between different GameObjects?

You can copy UnityEvent listeners between GameObjects by indexing existing persistent listeners and applying batch operations. This transfers target configurations and method calls reliably across components for UI workflow automation.

How do I inspect all persistent listeners on a UnityEvent?

Inspecting persistent listeners on a UnityEvent involves retrieving the listener count and indexing each target. This displays all configured component methods and call states attached to events like Button.onClick.

Does editing UnityEvent persistent listeners work at runtime?

Editing UnityEvent persistent listeners distinguishes runtime invocation from editor edits. Modifications to call states and listener configurations apply to editor-time persistent callbacks, requiring exact component and method names.

What is the best way to batch update UI button onClick handlers?

The best way to batch update UI button onClick handlers is using bulk addition and copy operations for persistent listeners. This automates migrating and auditing UnityEvent targets across multiple GameObjects efficiently.

Why does adding a UnityEvent listener require exact method names?

Adding a UnityEvent listener requires exact method names because persistent callbacks rely on precise reflection of component methods. Inaccurate names prevent the editor from successfully attaching the listener to the target GameObject.