unity-event
Wire UnityEvent persistent listeners at editor time
How do I install this agent skill?
npx skills add https://github.com/besty0728/unity-skills --skill unity-eventIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides a set of tools for inspecting and modifying UnityEvent persistent listeners within the Unity Editor. It allows for the automation of wiring button clicks, trigger callbacks, and other event-driven behaviors by managing listeners on GameObjects and components. No security risks or malicious patterns were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
1 file scanned · No issues
What does this agent skill do?
Unity Event Skills
Inspect and modify persistent listeners on UnityEvents (for example Button.onClick or Toggle.onValueChanged), the same listeners shown in the Inspector's event slots. Parameters come from the schema (GET /skills/schema?category=Event&wire=v2); execution and dryRun rules: root SKILL.md.
When to use
- Hooking up UnityEvents in the Inspector
- Wiring button or trigger callbacks
- Scripting persistent listeners
Rules
- Listeners added here are serialized with the prefab or scene, so they are configured at editor time.
event_invokeis valid only in Play mode or at runtime; outside it, onlyEditorAndRuntimelisteners fire. - The target locator is decided by the first one given, in this order:
targetEntityId,targetInstanceId,targetPath,targetObjectName. A locator that finds nothing is an error and never falls back to the next one. A name shared by several objects takes the first and says so inresolutionNotes; a partial name matching several is refused with the candidates. event_get_listenersreturnstargetEntityIdfor each listener. Pass it back toevent_add_listenerorevent_set_listenerto bind the exact same object (a specific component, an asset or a scene GameObject).targetalone is only a name and can be shared.- An
objectargument passes a Unity object to a method. Among overloads of that method name, the one whose parameter type is closest to the argument's type is used, and the stored listener resolves the same way when it runs. event_add_listenerneeds the exact component type and public method name on the target.event_remove_listenerandevent_clear_listenersare delete-class: under Approval or Auto they returnMODE_FORBIDDEN(the user must use Bypass or an Allowlist entry).
Pitfalls
event_createandevent_triggerdo not exist: UnityEvents are declared in component source; this module only wires listeners.event_subscribedoes not exist: useevent_add_listener.event_removedoes not exist: useevent_remove_listener.- For XR interaction events, use the xr module's
xr_add_interaction_event; for C# event code, write it through the script module.
Skills Overview
| Skill | Purpose |
|---|---|
event_list_events | List the UnityEvent fields on a component |
event_get_listeners | Read persistent listeners with their target ids |
event_get_listener_count | Count persistent listeners |
event_add_listener | Add a persistent listener |
event_add_listener_batch | Add several listeners in one call |
event_set_listener | Replace the listener at an index |
event_set_listener_state | Set a listener's call state |
event_remove_listener | Remove one listener by index (delete-class) |
event_clear_listeners | Remove all listeners of an event (delete-class) |
event_copy_listeners | Copy listeners from one event to another |
event_invoke | Invoke an event explicitly (runtime only) |
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/besty0728/unity-skills/unity-event">View unity-event on skillZs</a>