|
|
@ -13,19 +13,20 @@ namespace UnityTest |
|
|
|
{ |
|
|
|
{ |
|
|
|
public static bool GetConsoleErrorPause() |
|
|
|
public static bool GetConsoleErrorPause() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Assembly assembly = Assembly.GetAssembly(typeof(SceneView)); |
|
|
|
return false; |
|
|
|
Type type = assembly.GetType("UnityEditorInternal.LogEntries"); |
|
|
|
// Assembly assembly = Assembly.GetAssembly(typeof(SceneView)); |
|
|
|
PropertyInfo method = type.GetProperty("consoleFlags"); |
|
|
|
// Type type = assembly.GetType("UnityEditorInternal.LogEntries"); |
|
|
|
var result = (int)method.GetValue(new object(), new object[] { }); |
|
|
|
// PropertyInfo method = type.GetProperty("consoleFlags"); |
|
|
|
return (result & (1 << 2)) != 0; |
|
|
|
// var result = (int)method.GetValue(new object(), new object[] { }); |
|
|
|
|
|
|
|
// return (result & (1 << 2)) != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void SetConsoleErrorPause(bool b) |
|
|
|
public static void SetConsoleErrorPause(bool b) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Assembly assembly = Assembly.GetAssembly(typeof(SceneView)); |
|
|
|
// Assembly assembly = Assembly.GetAssembly(typeof(SceneView)); |
|
|
|
Type type = assembly.GetType("UnityEditorInternal.LogEntries"); |
|
|
|
// Type type = assembly.GetType("UnityEditorInternal.LogEntries"); |
|
|
|
MethodInfo method = type.GetMethod("SetConsoleFlag"); |
|
|
|
// MethodInfo method = type.GetMethod("SetConsoleFlag"); |
|
|
|
method.Invoke(new object(), new object[] { 1 << 2, b }); |
|
|
|
// method.Invoke(new object(), new object[] { 1 << 2, b }); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|