-
效果图
-
代码
[MenuItem("Custom/Run _F1")]
static void PlayToggle()
{
EditorApplication.isPlaying = !EditorApplication.isPlaying;
}
static MethodInfo clearMethod = null;
[MenuItem("Custom/Clear Console %#z")]
private static void ClearConsole()
{
if (clearMethod == null)
{
Type log = typeof(EditorWindow).Assembly.GetType("UnityEditor.LogEntries");
clearMethod = log.GetMethod("Clear");
}
clearMethod.Invoke(null, null);
}