public static object GetMainGameView() { System.Type T = System.Type.GetType("UnityEditor.GameView,UnityEditor"); System.Reflection.MethodInfo GetMainGameView = RCall.GetMethodInfo(T, "GetMainGameView", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); System.Object Res = GetMainGameView.Invoke(null, null); return(Res); }
private static MethodInfo getMethodInfo(string goName, string componentName, string methodName, string[] typeNames) { if (methodName == null || componentName == null) { Debug.LogWarning("Animator: Error parsing MethodInfo or Component with null value"); return(null); } string key = componentName + "." + methodName; List <Type> types = new List <Type>(); if (typeNames != null) { for (int i = 0; i < typeNames.Length; i++) { key += "." + typeNames[i]; } // setup type list foreach (string s in typeNames) { types.Add(Type.GetType(s)); } } if (dictMethodInfos.ContainsKey(key)) { return(dictMethodInfos[key]); } //dictMethodInfos.Add(key, Type.GetType(componentName).GetMethod(methodName,types.ToArray())); MethodInfo m; if (typeNames == null) { m = RCall.GetMethodInfo(getCMP(goName, componentName).GetType(), methodName); } else { m = RCall.GetMethodInfo(getCMP(goName, componentName).GetType(), methodName, types.ToArray()); } dictMethodInfos.Add(key, m); //dictMethodInfos.Add(key, getCMP(goName,componentName).GetType().GetMethod(methodName,types.ToArray())); return(dictMethodInfos[key]); }