Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by gak0 · Jun 22, 2013 at 03:45 AM · build-errormonodevelopworkflowkeyboard shortcut

Keyboard shortcuts to open first console error

My workflow is as follows, but I'd like to replace all mouse usage with the keyboard.

  • Write code in MonoDevelop

  • Alt tab to Unity3D, watch it pause while building

  • Double click on any errors

  • Alt tab back to MonoDevelop

I'd like to be able to press a key or two to replace that third step. I tried to ctrl + shift + c, but it appeared to do nothing when the console was already open.

If that is not possible, my next option is to use AutoHotKey or something similar to do it for me.

Maybe I should be looking to build from MonoDevelop or Visual Studio, so I can take advantage of their configurable keyboard settings?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wlk · Jun 17, 2015 at 02:06 PM 0
Share

I also have the same situation ...

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by roojerry · Jun 17, 2015 at 03:04 PM

Here you go:

 [MenuItem ("Edit/Clear Console %&c", false, 1)] // CMD + ALT + C
     static void ClearConsole () {
         var logEntries = System.Type.GetType("UnityEditorInternal.LogEntries,UnityEditor.dll");
         var clearMethod = logEntries.GetMethod("Clear", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
 #if UNITY_5
         var doubleClickErrorIndexMethod = logEntries.GetMethod("RowGotDoubleClicked", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
 #elif UNITY_4_6
         var doubleClickErrorIndexMethod = logEntries.GetMethod("OpenEntryFile", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
 #endif
         clearMethod.Invoke(null,null);
         doubleClickErrorIndexMethod.Invoke(null, new object[]{0});
     }


I created a menu item with a shortcut [CMD+ALT+C] to call, using reflection, some internal Unity Editor methods related to the the console log. This will first clear the console, and then if there is an error present, will call the method to open MonoDevelop to the location of the first error. I only had information on hand about the internal methods in 4.6 and 5. As with any internal classes, these are likely to change with new updates, and may be different before 4.6. You may have to do some more investigation of your own if you aren't on one of these 2 versions.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wlk · Jun 18, 2015 at 12:09 AM 0
Share

great! It worked in ver 5.0.2f1. Thank you brianruggieri-san !

avatar image gak0 · Jun 18, 2015 at 03:02 AM 0
Share

Awesome! :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

How can I stop the variable values reverting to its default values after being built? 1 Answer

Added custom DLL. Internal Compiler Error 6 Answers

How to generate Assembly-UnityScript-firstpass.csproj ? 1 Answer

Why does .Length not autocomplete in Monodevelop? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges