agentleFS
batihandevbatihandev/unity-mcp-skills/skills/event/SKILL.md

unity-event

Skill7 starsChanged 7 months agoMITView on GitHub

Use when users want to inspect or modify UI events like Button.onClick.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add a persistent listener to a UnityEvent (Editor time).

    line 35
  2. Distinctive:

    Remove a persistent listener by index.

    line 44
  3. Distinctive:

    Remove all persistent listeners from a UnityEvent.

    line 55
  4. Distinctive:

    Add multiple listeners at once.

    line 95

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Event Skills

Overview

Inspect and modify UnityEvents (e.g. Button.onClick).

Common Mistakes

DO NOT (common hallucinations):

  • event_create / event_trigger do not exist → UnityEvents are triggered at runtime, not from editor skills
  • event_subscribe does not exist → use event_add_listener
  • event_remove does not exist → use event_remove_listener
  • event_add_listener requires exact component type and method name on the target

Routing:

  • For XR interaction events → use xr module's xr_add_interaction_event
  • For C# event code → write via script module

Skills

event_get_listeners

Get persistent listeners of a UnityEvent. Parameters:

  • name / instanceId / path: Target GameObject locator.
  • componentName (string): Component name.
  • eventName (string): Event field name (e.g. "onClick").

event_add_listener

Add a persistent listener to a UnityEvent (Editor time). Parameters:

  • name / instanceId / path, componentName, eventName: Target event.
  • targetObjectName, targetComponentName, methodName: Method to call.
  • mode (string, optional): "RuntimeOnly", "EditorAndRuntime", "Off".
  • argType (string, optional): "void", "int", "float", "string", "bool".
  • floatArg, intArg, stringArg, boolArg: Argument value if needed.

event_remove_listener

Remove a persistent listener by index. Parameters:

  • name / instanceId / path, componentName, eventName: Target event.
  • index (int): Listener index.

event_invoke

Invoke a UnityEvent explicitly (Runtime only). Parameters:

  • name / instanceId / path, componentName, eventName: Target event.

event_clear_listeners

Remove all persistent listeners from a UnityEvent.

ParameterTypeRequiredDefaultDescription
namestringNonullGameObject name
instanceIdintNo0GameObject instance ID
pathstringNonullGameObject hierarchy path
componentNamestringNonullComponent name
eventNamestringNonullEvent field name (e.g. "onClick")

Returns: { success, removed }

event_set_listener_state

Set a listener's call state (Off, RuntimeOnly, EditorAndRuntime).

ParameterTypeRequiredDefaultDescription
namestringNonullGameObject name
instanceIdintNo0GameObject instance ID
pathstringNonullGameObject hierarchy path
componentNamestringNonullComponent name
eventNamestringNonullEvent field name
indexintNo0Listener index
statestringNonullCall state: "Off", "RuntimeOnly", or "EditorAndRuntime"

Returns: { success, index, state }

event_list_events

List all UnityEvent fields on a component.

ParameterTypeRequiredDefaultDescription
namestringNonullGameObject name
instanceIdintNo0GameObject instance ID
pathstringNonullGameObject hierarchy path
componentNamestringNonullComponent name

Returns: { success, component, count, events }

event_add_listener_batch

Add multiple listeners at once. items: JSON array of {targetObjectName, targetComponentName, methodName}.

ParameterTypeRequiredDefaultDescription
namestringNonullGameObject name
instanceIdintNo0GameObject instance ID
pathstringNonullGameObject hierarchy path
componentNamestringNonullComponent name
eventNamestringNonullEvent field name
itemsstringNonullJSON array of {targetObjectName, targetComponentName, methodName}

Returns: { success, added, total }

event_copy_listeners

Copy listeners from one event to another.

ParameterTypeRequiredDefaultDescription
sourceObjectstringYes-Source GameObject name
sourceComponentstringYes-Source component name
sourceEventstringYes-Source event field name
targetObjectstringYes-Target GameObject name
targetComponentstringYes-Target component name
targetEventstringYes-Target event field name

Returns: { success, copied }

event_get_listener_count

Get the number of persistent listeners on a UnityEvent.

ParameterTypeRequiredDefaultDescription
namestringNonullGameObject name
instanceIdintNo0GameObject instance ID
pathstringNonullGameObject hierarchy path
componentNamestringNonullComponent name
eventNamestringNonullEvent field name

Returns: { success, count }


Recipe path rule: ../../recipes/event/<command>.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.