unity-event

Configure persistent UnityEvent listeners on components at editor time.

2|Updated May 18, 2026
One-click install
npx skills add https://github.com/pcone-mm/NewFPG --skill unity-event-pcone-mm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-event
Source: https://github.com/pcone-mm/NewFPG/tree/main/.agents/skills/unity-skills/skills/event
Command: npx skills add https://github.com/pcone-mm/NewFPG --skill unity-event-pcone-mm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Wiring UnityEvent callbacks in the Unity Inspector is repetitive and error-prone, especially when connecting many buttons, toggles, or triggers across a scene. This Skill lets you inspect, add, remove, replace, and copy serialized persistent listeners on UnityEvents programmatically, without manually clicking through Inspector drop slots. ## Core Features & Use Cases - Listener Inspection: List all UnityEvent fields on a component and read their persistent listeners, counts, and call states. - Listener Wiring: Add, replace, batch-add, or copy persistent listeners between events, with support for call modes (Off, RuntimeOnly, EditorAndRuntime) and static arguments (int, float, string, bool, object references). - Runtime Invocation: Invoke a UnityEvent explicitly during Play mode for testing event chains. - Use Case: You have a UI canvas with ten buttons that each need an onClick callback to a GameManager method. Use event_add_listener_batch to wire all of them in one operation instead of configuring each Inspector slot by hand. ## Quick Start Ask the AI to add a persistent listener to the onClick event of the Button component on your Canvas object that calls the StartGame method on the GameManager.

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 UnityEvent listener in the Unity Editor programmatically?

Use event_add_listener with the target GameObject locator, component name, event field name, and the target object, component, and method to call. It writes a persistent listener serialized to the scene or prefab, the same as wiring it in the Inspector.

How to wire a Button onClick callback without using the Inspector?

Call event_add_listener on the Button component's onClick event, specifying the target GameObject, component, and public method name. You can also set the call mode to RuntimeOnly or EditorAndRuntime and pass static arguments if the method needs them.

Can I add multiple UnityEvent listeners at once in Unity?

Yes, event_add_listener_batch accepts a JSON array of target object, component, and method entries and adds them all to one event in a single call. It returns the number of listeners successfully added.

Why can't I remove a UnityEvent listener with this skill?

event_remove_listener and event_clear_listeners are marked as Delete operations and are blocked in semi-automatic mode. They only execute in Bypass mode or when the skill is added to the allowlist.

Does event_invoke work in edit mode?

event_invoke only fully works in Play mode or at runtime. In the editor it only triggers listeners whose call state is EditorAndRuntime, so RuntimeOnly listeners will not fire outside Play mode.

What is the difference between persistent listeners and C# event subscriptions?

Persistent listeners are serialized UnityEvent callbacks stored in scenes and prefabs and visible in the Inspector, which is what this skill manages. C# event subscriptions in code are handled separately through the script module, not this one.