find_derived_classes
Finds all types inheriting from a specified base class, including indirect subclasses. Use the assembly filter to isolate a game's MonoBehaviour scripts for Mod hooking.
Instructions
找出所有继承自某个基类的类型(含间接继承);配 assembly= 可筛出游戏自己的 MonoBehaviour 脚本(找脚本的必备工具)。
total 是匹配总数,被 limit 截断时 has_more=true。
两个最常见的用法:
· 找游戏自己写的 MonoBehaviour 脚本(Mod 最常 Hook 的目标):
find_derived_classes(base_full_name="UnityEngine.MonoBehaviour", assembly="Assembly-CSharp")
传 assembly 比按程序集名前缀猜「哪些是引擎自带的」可靠。
· 找所有 UI 面板 / 数据服务:把 base_full_name 换成对应基类即可。
基类不必在当前索引的程序集里(如 UnityEngine.MonoBehaviour 属于框架程序集),这种情况结果依然有效,并在 note 里如实说明。
total 是匹配总数,不受 limit 影响;returned 才是本次返回条数。
若 has_more 为 True,说明被 limit 截断了,还有结果没返回。
Args:
base_full_name: 基类完整名,如 "UnityEngine.MonoBehaviour"。
assembly: 只看该程序集(子串匹配,如 "TeamTapas")。留空不限。
limit: 最多返回多少条(total 仍是匹配总数)。
Returns: {ok, found, base, total, returned, has_more, items: [{index, full_name, image, field_count, method_count}]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| assembly | No | ||
| base_full_name | Yes |