Added Unity project files

This commit is contained in:
2026-06-07 16:58:24 +01:00
parent 3cc05d260b
commit 23bbcab156
3942 changed files with 453676 additions and 0 deletions

View File

@ -0,0 +1,40 @@
using System;
using System.Reflection;
using UnityEngine.Assertions;
namespace VRWorldToolkit.Editor
{
/// <summary>
/// Utility for setting and getting console error pause flag with reflection
/// </summary>
public static class ConsoleFlagUtil
{
private static readonly System.Type systemType;
private static MethodInfo mMethod_GetConsoleErrorPause;
private static MethodInfo mMethod_SetConsoleErrorPause;
static ConsoleFlagUtil()
{
systemType = Assembly.Load("UnityEditor.dll").GetType("UnityEditor.ConsoleWindow");
Assert.IsNotNull(systemType);
}
public static bool GetConsoleErrorPause()
{
if (mMethod_GetConsoleErrorPause == null)
mMethod_GetConsoleErrorPause = systemType.GetMethod("GetConsoleErrorPause", BindingFlags.Static | BindingFlags.Public);
Assert.IsNotNull(mMethod_GetConsoleErrorPause);
return (bool)mMethod_GetConsoleErrorPause.Invoke(null, null);
}
public static void SetConsoleErrorPause(Boolean enabled)
{
if (mMethod_SetConsoleErrorPause == null)
mMethod_SetConsoleErrorPause = systemType.GetMethod("SetConsoleErrorPause", BindingFlags.Static | BindingFlags.Public);
Assert.IsNotNull(mMethod_SetConsoleErrorPause);
mMethod_SetConsoleErrorPause.Invoke(null, new object[] { enabled });
}
}
}