Unity 编辑器扩展之反射重载的私有方法
效果: 直接上菜了喂 using System; using System.Reflection; using UnityEditor; using UnityEngine; public class MyReflection : EditorWindow { /* * 反射获取私有方法 */ [MenuItem("MyEditor/反射/MyReflectionTest/GetName()")] public static void Execute() { Type type = typeof(MyReflectionTest); object obj = Activator.CreateInstance(type); MethodInfo method = type.GetMethod("GetName", BindingFlags.NonPublic | BindingFlags.Instance,null, CallingConventions.Standard, new Type[] { },null); method.Invoke(obj,null); } [MenuItem("MyEditor/反射/MyReflectionTest/GetName(string name)")] public static void Execute1() { Type type =