1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Assembly assembly = Assembly.Load("Assembly-CSharp-Editor"); System.Type[] types = assembly.GetTypes(); for (int i = 0, iMax = types.Length; i < iMax; i++) { if (types[i].IsInterface) continue;
System.Type[] ins = types[i].GetInterfaces(); foreach (var item in ins) { if (item == typeof(IEditorPrefs)) { object o = System.Activator.CreateInstance(types[i]); MethodInfo method = item.GetMethod("ReleaseEditorPrefs"); method.Invoke(o, null); break; } } }
|