unity-编辑器快捷按键

时间:2020-07-12 14:22:45   收藏:0   阅读:71
    [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);
    }
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!