This editor utility can lock/unlock unity script compile from menu item. See more https://raspberly.hateblo.jp/entry/InvalidateUnityCompile
August 6, 2020 ยท View on GitHub
using UnityEngine; using UnityEditor;
///
var menuPath = "Compile/Lock";
var isLocked = Menu.GetChecked(menuPath);
if (isLocked)
{
Debug.Log("Compile Unlocked");
EditorApplication.UnlockReloadAssemblies();
Menu.SetChecked(menuPath, false);
}
else
{
Debug.Log("Compile Locked");
EditorApplication.LockReloadAssemblies();
Menu.SetChecked(menuPath, true);
}
}
}