reflection-method-call

Invoke C# methods at runtime via reflection with a formal input schema.

3.8k|349|Updated Apr 2, 2025
One-click install
npx skills add https://github.com/IvanMurzak/Unity-MCP --skill reflection-method-call-ivanmurzak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reflection-method-call
Source: https://github.com/IvanMurzak/Unity-MCP/tree/main/Unity-MCP-Plugin/.claude/skills/reflection-method-call
Command: npx skills add https://github.com/IvanMurzak/Unity-MCP --skill reflection-method-call-ivanmurzak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unleash dynamic method invocation in Unity MCP projects by using reflection to call methods by schema, including private methods, and receive structured results.

Core Features & Use Cases

  • Dynamic method invocation: call any method given a schema, including private ones, at runtime.
  • Safe probing and returns: requires a method reference and serialized input parameters, returns a serialized result.
  • Use Case: debugging or extending behavior in complex Unity workflows where static bindings are impractical.

Quick Start

Run the CLI tool with a prepared JSON input detailing the target method, optional input parameters, and target object to execute the call.

Frequently Asked Questions about reflection-method-call

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

FAQPage Schema
How do I invoke a private C# method at runtime in Unity?

You can invoke private C# methods at runtime in Unity by using reflection to locate the method via a formal schema and passing serialized input parameters to execute the call dynamically.

What is dynamic method invocation and when do I need it for debugging?

Dynamic method invocation uses reflection to locate and execute methods by schema at runtime, which is needed for debugging or extending complex Unity workflows where static bindings are impractical.

How do I call a method using reflection with a JSON schema?

You call a method using reflection by providing a JSON input detailing the target method filter, optional input parameters, target object, and a main thread execution flag to return a serialized result.

Can I use reflection to call methods and return serialized results in Unity MCP?

Yes, you can use reflection in Unity MCP to call any specified method given a schema and receive a structured, serialized result back from the runtime execution.

Does invoking non-public methods via reflection require executing in the main thread?

Invoking non-public methods via reflection includes an optional executeInMainThread parameter, allowing you to specify whether the dynamic method call runs on the Unity main thread.