Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Script Inspector 3 - World's Fastest IDE for Unity

Discussion in 'Assets and Asset Store' started by Flipbookee, Jun 2, 2012.

?

What would you like to see in the next update?

Poll closed May 17, 2018.
  1. Line numbers

    140 vote(s)
    36.9%
  2. Code folding

    234 vote(s)
    61.7%
  3. More color schemes

    43 vote(s)
    11.3%
  4. Customizable color schemes

    71 vote(s)
    18.7%
  5. Search functionality

    152 vote(s)
    40.1%
  6. Lower price :D

    104 vote(s)
    27.4%
  7. No thanks, it's fine as it is :)

    11 vote(s)
    2.9%
Multiple votes are allowed.
  1. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Yes, I know. Inline declarations for out variables (added in C# 7.0) is next on my to-do list to support in Si3.
     
  2. jensen_305

    jensen_305

    Joined:
    May 15, 2018
    Posts:
    27
    Script Inspector > Editor > Unity Magic Methods > Opening Brace on same line

    Seems to completely ignore this option. Btw outside observer. No idea what a Unity Magic Method was. Those are Unity Methods. Nothing magic about them. Weird extra word to add confusion I guess.

    code deleted because irrelevant.

    Ok I get it you can only control braces in Unity methods. Ehh. I'll stick with VS Studio. I don't see auto formatting either and I'm a messy coder with specific requirements like braces on same line. Seems like a cool plugin though.
     
    Last edited: Mar 26, 2021
  3. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @jensen_305, the Opening brace on same line option is only for the Unity magic methods and it's applied when they are auto-generated by Si3. Sorry, that wasn't clear enough, I guess.

    Unity magic methods are the methods Unity calls through Reflection on objects of a type derived from MonoBehaviour, EditorWindow, Editor, ScriptableObject, ScriptableWizard, or AssetPostprocessor class. These are not virtual methods declared in the base classes or methods declared in an interface. Instead, these are methods that, when added with the exact method signature, get magically called by Unity through Reflection, even though no code is referencing them. So yeah, there is something "magical" about them and they are special in that aspect at least.

    Unity scripting documentation refers to these methods as "Messages", I guess as an analogy to the misleadingly named SendMessage, SendMessageUpwards, and BroadcastMessage methods of MonoBehaviour which also call methods through Reflection.

    So, since these magic methods are not declared anywhere, a code editor doesn't know their signature, thus it cannot help to declare them with the exact method signature. But since Si3 is specifically made for scripting in Unity, I hardcoded it to allow auto-generating all those methods. Most people at that time were calling them Unity Magic Methods, so naturally, I adopted that terminology.

    Later on, Visual Studio Tools for Unity copied that feature (although, not as nice as it works in Si3 IMHO) using Unity Scripting docs terminology and calling them "Messages". If you ask me, I'd say there's nothing messagy in them ¯\_(ツ)_/¯

    Anyway, sorry for the rant, I just wanted to explain the option only controls where Si3 would place the opening brace on generating any of these methods, so it would match your preferred style and the surrounding code. It doesn't control automatic code formatting if that was what you were looking for, simply because there is no auto-formatting feature in Si3 yet (it has auto-indent though).

    Auto-formatting is a highly demanded feature, and it will be added soon-ish, but for now, it isn't there yet. Sorry if that's a deal-breaker for you! Either wait for it to be added or I can arrange a refund?
     
  4. valmyr

    valmyr

    Joined:
    Jan 31, 2018
    Posts:
    23
    Hi, just like to tell you that this is a really useful tool!

    how can we make shift+delete after highlighting text to work similarly to ctrl+x?

    Also renaming of variables and methods would be very useful. I find myself going to vs just to do that. If we could have that, it will significantly minimize the need to use VS.

    I also noticed some descriptions are not being displayed when you hover on them. Ex. SceneManager.
    But there is a description in VS.

    SI3:
    upload_2021-4-11_18-19-33.png

    VS:
    upload_2021-4-11_18-19-52.png
     
    Flipbookee likes this.
  5. valmyr

    valmyr

    Joined:
    Jan 31, 2018
    Posts:
    23
    This one should be an error but SI3 is not highlighting it.

    upload_2021-4-11_18-28-40.png
     
    Flipbookee likes this.
  6. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Thanks @rainmax! :cool:

    Yes, I can bind Shift+Delete to the Cut command.

    Rename refactoring feature is in development and it will be released soon.

    Descriptions for Unity symbols need to be updated, thanks for reminding me to do that!

    And for the last one, Si3 is not highlighting all semantic errors but only some of them, mostly those that would break auto-completion and resolving symbol types. It highlights all syntax errors though. This is because of the shortcut I had to take - I wrote all the parsing and semantic analysis for C# code from scratch, which took me almost 9 years so far, and I'm still working on that, trying to complete the syntax for C# version up to 7.3 (a few things still left there). If I was implementing all the possible errors along the way, I would have to cut on something else.

    Unfortunately, Roslyn didn't exist yet at the time when I started this project - using that would have saved me a couple of years of work. Now it exists, and I'm considering switching to it in the future if that doesn't hurt the performance.
     
  7. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Fun fact: Did you know there are some assets on the Asset Store with more 5-star reviews than Si3?

    Hehe, I'm kidding ;) I know you know, but I bet you didn't know there are only 17 of those!

    My highest respect to the authors - this is the list (non-free, five-star assets only):
    1. Playmaker - 442 five-star reviews
    2. Gaia Pro - Terrain & Scene Generator - 424
    3. Gaia 2 - Terrain & Scene Generator - 408
    4. Corgi Engine - 2D + 2.5D Platformer - 328
    5. Dialogue System for Unity - 308
    6. Rewired - 302
    7. Pro Camera 2D - The definitive 2D & 2.5D Unity camera plugin - 297
    8. Easy Save - The Complete Save Data & Serialization Asset - 281
    9. Odin - Inspector and Serializer - 263
    10. UFPS: Ultimate FPS - 242
    11. Amplify Shader Editor - 236
    12. Adventure Creator - 216
    13. EasyRoads3D Pro v3 - 215
    14. Behavior Designer - Behavior Trees for Everyone - 208
    15. Easy Movie Texture (Video Texture) - 208
    16. NGUI: Next-Gen UI - 205
    17. Third Person Controller - 205
    And next is Script Inspector 3 with its 201 five-star reviews :rolleyes:

    Thank you all for making Si3 one of the top 20 assets of the entire Asset Store! :cool:
     
  8. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    50
    hello, is it possible to disable SI Console ?
     
    Flipbookee likes this.
  9. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Yeah... It opens automatically if the built-in Unity Console window is open. So if you're using another console alternative and don't need the built-in Console window, just close it and also close the SI Console. If you don't use an alternative console, then you probably want to use the SI Console instead of the built-in Console because it gives a couple of additional options not available in the built-in Console:
    • Right-clicking the entries in the SI Console allows easy navigation through the call stack leading to them.
    • It allows changing the font in it to a monospaced font.
    • It offers some options to automatically focus the SI Console.
    The newer versions of Unity also allow navigating through the call stack, but not as easy as in the SI Console. In the past when that option was missing in the built-in Console, this feature of the SI Console was much more helpful, but these days some may find it not essential. If that's why you're asking how to disable the SI Console then do this, please:
    • Open the FGConsole.cs script (use Alt+Shift+O on PC or Alt-Cmd-O on Mac to quick-open any script).
    • Go to line 159 (Ctrl+G on PC or Cmd-G on Mac). There should be a method called OpenIfConsoleIsOpen().
    • Comment out or delete all the code in that method.
    • Save the changes to FGConsole.cs and then let Unity compile that.
    • Close the SI Console window and it won't open automatically anymore. You can still open it through the main menu: Window -> Script Inspector 3 -> SI Console.
    I hope this helps. :)
     
    Eater_Games likes this.
  10. Finity

    Finity

    Joined:
    Jan 25, 2013
    Posts:
    10
    The following is not valid in SI3. Why?
    Code (CSharp):
    1.  
    2. private void OnTriggerEnter(Collider other)
    3. {
    4.     if(other.gameObject.TryGetComponent<MyObj>( out var myObj))
    5.     {
    6.     }
    7. }
    8.  
     
    Flipbookee likes this.
  11. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Yes, that's because the myObj variable is declared "inline", which is a feature of the language added in C# 7.0 and the version of Si3 on the Asset Store doesn't support that feature yet, but it will support that with the latest update that I'm planning to release later today.

    This issue was pointed out by @jensen_305 already and I confirmed that's the next thing I'm going to work on:
    However, I didn't expect it's going to be that complicated to support that!

    The issue was that to deduce the type of the myObj variable in your code example, Si3 has to resolve the overloaded method TryGetComponent. And to resolve the overloaded method, it needs to know the type of each argument passed to the method call. So, that was a chicken-egg situation that took me quite some time to solve and adapt the existing code to deal with that...
     
    Finity and valarnur like this.
  12. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Hiya friends! Guess what's new? :)

    Script Inspector 3
    version 3.0.29
    got just released on the Asset Store

    And this is what's new in it:
    • C# 5.0-7.3 support:
      • interpolated strings with syntax highlighting and autocomplete
      • inline out variable declarations
    • Full support for Chinese, Japanese, and Korean characters
    • Workaround for Unity's buggy positioning of the composition popup window
    • New code snippets: "prop" and "propg" - thanks @RGAMESR
    • Updated Visual Studio Dark color theme to match VS 2019
    • Improved resolving of method overloads
    • Reduced recursion depth for C# semantic analysis
    • Fixed semantic analysis of void delegate types
    I hope you'll enjoy this free update. :cool:
     
  13. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Well, I tried and it didn't work because Unity counts those files as "native" assets for which we can't override the built-in inspector in the way we can do that for any other type of asset... Except for the .js files which Unity sees as UnityScript files.

    Next, I'll try to allow editing those files in standalone Si3 windows, at least.
     
  14. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Oh, it looks like I forgot to mention one additional item in the list above:
    • Workaround for GUIStyle.Draw exception on Linux
     
  15. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Hello,

    When will code folding be available?
     
    Flipbookee likes this.
  16. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    I hope I’ll get back to that very soon. While adding support for CJK characters, I noticed I wasn’t too far from completing that task. I also simplified some parts of the text drawing code that should make the code folding feature easier to complete.
     
    Lars-Steenhoff likes this.
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Oops, it looks like the latest Si3 update completely broke autocompletion for projects working on C# 4 only :oops:

    I'm very sorry about that! I'm fixing that immediately, so expect a critical update today...
     
    zKici likes this.
  18. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Attention - Critical Update!

    Script Inspector 3
    version 3.0.30
    got just released on the Asset Store

    This is what's new in it:
    • CRITICAL FIX: Fixed autocompletion for C# 4
    • C# 5.0-7.3 support:
      • Throw expressions
      • Default literal expressions
      • Fixed scope of inline declared out variables
      • Fixed autocomplete for "var" after "out"
      • Fixed resolving type of implicitly typed out variables in arguments of a generic method call
    • Fixed positioning of IME composition window in the Inspector of Unity 2019+
    • Fixed warning in Unity 2021+ about obsolete API
    • Fixed opening log entries in SI Console in Unity 2021+
    • Fixed positioning of Si3 floating windows in Unity 2019.4+ - thanks @jrDev
    • Fixed custom property drawer for UnityEvents to find its target set to a static member
    • Fixed resolving type of integer literals
    • Optimized resolving concrete generic types

    Not many new features, mostly bug fixes, but there wasn't much time for anything more than this since the last update.

    Happy coding! :cool:
     
    Last edited: May 30, 2021
  19. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    I almost forgot to mention... Today is Script Inspector's birthday ;)

    upload_2021-5-30_0-32-9.png
     
  20. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    @Flipbookee Is this possible? I'm here playing with jslib files and they are a mess in VS...

    Thanks,
    jrDev
     
    Flipbookee likes this.
  21. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    I tried and this was my reply to that post:

    So yeah, I'll try again and for sure it won't be possible to edit them in the Inspector window, but eventually only in the standalone SI tabs.
     
  22. Derek_Brouwer

    Derek_Brouwer

    Joined:
    Nov 25, 2016
    Posts:
    2
    I have a question.

    I'm wondering where you are writing the tool's preferences to?

    I was going to try convince my team to add this to our project, but wanted to know where the user preferences were saved so I can make sure they are being ignored by source control. That way people can choose to have it replace their external tool or use it only if they need it.

    Separate thought, would there be a downside to just ignoring the entire Plugins/Editor/ScriptInspector3 folder (if it's not writing to anywhere outside this folder)?

    Thanks!
     
    Flipbookee likes this.
  23. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Si3 saves its preferences in EditorPrefs, so yeah, they'll be ignored by source control.

    Yes, the whole folder can be safely excluded from source control.

    Wait, I'll send you a copy to try it out before you decide. ;)
     
  24. Derek_Brouwer

    Derek_Brouwer

    Joined:
    Nov 25, 2016
    Posts:
    2
    Thank you for the info and fast reply!

    I already have a copy myself, but thank you for the offer :)
     
    Flipbookee likes this.
  25. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Woot?!? Script Inspector 3 is 50% off currently on the Asset Store ;)
    upload_2021-6-29_8-41-42.png
    Check it out here: http://u3d.as/2ZC

    And don't forget to read all the glowing reviews!
    Well, okay, maybe not all because it has more than 200 five-star reviews! :cool: (yes, more than two hundred, not a typo)
     
    Lars-Steenhoff likes this.
  26. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    I hope this weekend to finish and release another update that includes an important fix for the tab characters not indenting the code beyond a certain level depending on screen dpi in combination with the chosen font and font size.

    Besides that, it has many other tiny fixes you may never noticed, and it has better support for latest C# features, one of which is the support for tuple types, although I’m not sure if I can fully finish that in time for the release - it’s quite a complex feature, but let’s keep the fingers crossed ;)
     
  27. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Just a friendly reminder :rolleyes: This offer expires in less than 24 hours

    Check it out here: http://u3d.as/2ZC
     
  28. Emre_Akpolat

    Emre_Akpolat

    Joined:
    Feb 17, 2013
    Posts:
    6
    Hi, SI3 helped me a lot, thanks for the product.

    Can you please write what commands SI3 adds to component context menu/kebab menu? I know it adds "Edit in Script Inspector" for one.

    I made some wrong clicks due to an unrelated issue and trying to make sure I didn't break stuff.
     
    Flipbookee likes this.
  29. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    :cool:

    Yes, it adds that and if there's an Editor class for that component type, it also adds "Edit this Editor class":
    upload_2021-7-10_19-48-27.png
     
    AthrunVLokiz likes this.
  30. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Wait, what?!? Script Inspector 3 is on sale again :eek:



    Another chance for anyone who missed it a week ago - now again at a 50% discount and you save $20
    http://u3d.as/2ZC
     
    Lars-Steenhoff likes this.
  31. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    476
    Hi
    Can Si3 edit scripts that are not physical files?
    For example, I planing to store some script code in ScriptableObject as a serialized string.
    Is there an API to open and edit the script from the string?

    Thanks

    UPD
    If there is no such API then how difficult it would be for me to implement this by myself?
     
    Flipbookee likes this.
  32. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Hey @MUGIK, sorry for the late reply...

    Well, there is a method in FGTextBuffer called InitializeWithCSharpCode which was doing exactly that some long time ago, but I'll have to find a code example of how to use that method and it may need some updating because it's been quite a while since I added and used that. It isn't called anymore, so it may be outdated now, but I'll check that too.

    This method was part of my attempt to create an immediate window with full autocomplete, which I had to put on hold while working on other more urgent issues.
     
    MUGIK likes this.
  33. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    476
    Thanks for the reply! You could ignore my previous post, I gave up on that idea. Sorry for bothering you.
    Have a nice day!
     
    Flipbookee likes this.
  34. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Okay, no worries :)
     
  35. iloveloon

    iloveloon

    Joined:
    Sep 18, 2019
    Posts:
    1
    Hi, almost perfect IDE for me so far, do you have plan to implement replace text in selected area and code folding?
     
    Flipbookee likes this.
  36. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Hey, thanks @iloveloon! :cool:

    Yeah, I think I can easily add an option for Replace All to work on the selected text only. Code folding is on my to-do list and already half done, although on hold currently while I'm working on something much more important - finishing support for the latest versions of C# that are now supported in Unity.

    Thanks for sharing your experience with Si3 and what you'd prefer to see next in it! :)
     
    iloveloon likes this.
  37. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Just a friendly reminder to anyone interested in using Si3 that the sale ends in less than 24 hours... Apologies to everyone else for the spam.
     
    iloveloon likes this.
  38. valmyr

    valmyr

    Joined:
    Jan 31, 2018
    Posts:
    23
    HI, I managed to add support for SHIFT+DEL and SHIFT+INS by modifying FGKeyboardHook.cs.

    Hoping you could add support for F2 rename symbols and more descriptions on hover. I bind it to "Replace in Files" in the meantime in that same file.
     
    Flipbookee likes this.
  39. valmyr

    valmyr

    Joined:
    Jan 31, 2018
    Posts:
    23
    Also, here are some additional lines where SI3 should display as errors but does not:

    upload_2021-9-21_18-8-6.png

    Note the datatype and the value.
     
    Flipbookee likes this.
  40. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Nice! Could you send me the changes, please? :)
     
  41. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    I tried searching around and couldn't find a solution, but I'm on 2020.3.21f1 and it's only showing me the default inspector for scripts. Well, if I click the three dots icon in the inspector, I get a pop-out menu that looks like it's coming from SI3 (even has "About Script Inspector 3..." at the bottom). But the actual text content displayed looks like the default inspector where it is just plain, uncolored text, and uneditable in any way. What am I missing? I can open scripts up in their own SI3 tab just fine. They just don't show up as default text in the inspector tab.
     
    Flipbookee likes this.
  42. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Interesting... Sounds like something has changed in Unity, so I'll check what.

    Thanks for reporting this!
     
  43. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @Brady, Si3 works for me in the Inspector tab in Unity 2020.3.21f. I tested it in a new empty project on Windows. Can you also check in a new empty project? Do you have any other plugins related to the Inspector tab maybe?
     
  44. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    This was a brand new project, though I did select the URP preset project. It defaulted to include Version Control (Plastic), and at first I thought perhaps Plastic's way of locking down an inspector until you check out the asset was interfering. But I removed Plastic from the project, reopened, and it still didn't work. I did, however, just try doing the same again and it works in that new project. Bizarre.

    Here are all the packages in the affected project. There are no other plugins or assets besides SI3:

    upload_2021-10-28_15-39-49.png

    Any idea what might be interfering with it?
     
    Flipbookee likes this.
  45. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Oh, if it’s a brand new project, could you maybe pack it and send it to me? I’ll try the same as you did, but it may just work as in your second attempt, so better if I check the project where it doesn’t work.
     
  46. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @Brady, that's bizarre indeed. No idea what might have happened, except that maybe importing Si3 didn't work well, so you could try reimporting it and see what happens.

    I tried your steps, but it works fine. It would be best if you just pack and send me the affected project, so I can check right inside it.
     
  47. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Unfortunately, the project isn't so small now. But I'll see if I can get some time to revert back to the earliest stage of the project in source control and then send it to you. My recent new Unity projects have all had some different wonky thing about them and it's really bugging me. Like, one of them will never preserve my UI layout no matter what, and trying to select a saved one crashes Unity. Yet this doesn't happen in any of my other projects, even using the same version of Unity. So it may just be one of those kind of random weird things. But if I do get the sample project together for you, what's the best way to send it?
     
    Flipbookee likes this.
  48. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Cool, just email it to flipbookee on gmail maybe, or send me a download link in a private message.
     
  49. BenniKo

    BenniKo

    Joined:
    Mar 24, 2015
    Posts:
    100
    Flipbookee likes this.
  50. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    I've been investigating that, and it might be possible to do something similar in Si3 as Microsoft's Copilot plugin for VS Code. I've got access to the OpenAI Codex beta program and I checked up the API - looks fairly simple to use. However, it won't be free but based on subscription, measured by the amount of "tokens" sent to and received from the service, which might be a major blocker for most of you, and for me as well.

    I had a chance to play with the OpenAI Codex and it was a surprisingly shocking experience! It left me speechless, staring at the results for a few minutes in confusion and with a dropped jaw. I didn't expect it would know how to write C# code for Unity, but it did, and it even knew how to do meaningful stuff. It couldn't do everything I asked it to do, though - I was gradually asking it to write harder and more complicated code, and it started giving me some nonsense code after some time. But still, what it did right was extremely impressive!

    So yes, that has raised my interest in these opportunities. There's an increasing number of similar projects appearing recently, and I'm still investigating those as potential alternatives. And I've learned (so far the basics only) how the AI/ML transformer networks work, just out of curiosity for now... So, I'll keep you informed if anything happens in this direction.
     
    BenniKo, zKici, Stexe and 1 other person like this.