LoginSignup
2
0

More than 1 year has passed since last update.

UnityEditorでEditor実行時にErrorPauseを強制的に解除する

Posted at

作業環境
Unity2022.1.9f1

以下のスクリプトをEditorフォルダ以下に入れてください

using UnityEditor;

public class ForceDisableEditorErrorPause
{
    [InitializeOnEnterPlayMode]
    static void RunOnEnterPlayMode()
    {
        var assembly = typeof(Editor).Assembly;
        var type = assembly.GetType("UnityEditor.ConsoleWindow");
        var consoleWindow = EditorWindow.GetWindow(type);
        var methodInfo = type.GetMethod("SetConsoleErrorPause");

        methodInfo.Invoke(consoleWindow, new object[] {false});
    }
}

実行時にConsoleウィンドウが前面に出てきちゃうので、GetConsoleErrorPauseがtrueだったら。という風にしてもよさそうです

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0