I am trying to open my editor window via MethodInfo.Invoke but it will not work .
if (GUI.Button(new Rect(0, 0, 200, 20), "Click Me"))
{
Type thisType = typeof(EditorWindow);
MethodInfo theMethod = thisType.GetMethod("GetWindow", new Type[]{typeof(MyWindow)});
theMethod.Invoke("GetWindow", new object[]{typeof(MyWindow)});
}
This works so why cant i get my editor window to show up
if (GUI.Button(new Rect(0, 0, 200, 20), "Click Me"))
{
Type thisType = typeof(TestThis);
MethodInfo theMethod = thisType.GetMethod("Up", new Type[]{typeof(String)});
theMethod.Invoke("Up", new object[]{" word "});
}
public class TestThis
{
public static void Up()
{
Debug.Log("Works");
}
public static void Up( String T)
{
Debug.Log(T);
}
}