Search Unity

Utilities Script Inspector 3

Discussion in 'Tools In Progress' started by Flipbookee, Aug 10, 2013.

  1. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hey guys, are you still around? I have a little task for someone who feels like a ninja today ;), someone who's not afraid to dig a little bit into the plugins documentation of VS or MD in order to make a small nifty extension that connects to Si3 and syncs the breakpoints in both directions. :p This may sound like a big challenge but I believe it won't be that big for a certified ninja superhero :) and I'll be around to help as much as I can. Of course, I'll also provide full support for that in Si3 and all that...

    I'm trying to release a new version of Si3 this weekend and I have no time to do that extension myself currently, but I hate it when I fool myself and try to toggle breakpoints in Si3 ;)

    So what do you say? :)
     
  2. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    No more ninjas? :p

    I don't know if that sounds too scary or everyone is busy doing their stuff, but the idea is very simple. This extension for the external IDE has to install a socket listener on a port that Si3 will try to connect to and once that happens to send over a list of all current breakpoints. Then keep the connection alive and send that list again on application focus lost and toggle a breakpoint whenever it receives such command from Si3. It's that simple, no GUI or menu items or anything visual, only a pure socket service. Si3 will that care of all the rest ...
     
  3. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    I would look into it, if only had at least some experience with MD and VS plugin development. Otherwise, the price to pay for starting from scractch, would make the extension's complexity/simplicity irrelevant, as I would be needing to investigate everything anyway.

    Sounds interesting, although for someone with a background or knowledge on this plugins.

    To clarify, that would be exclusively to sync breakpoints set from Si3, right?
     
    Flipbookee likes this.
  4. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Well, to synch the breakpoints in both directions and toggle them anywhere you want, either in external IDE or in Si3. The synchronization would happen on connect and when the external IDE is loosing focus, while toggling would only happen in one direction - Si3 to IDE.

    I've only looked at VS extensions API and it looks pretty simple. There's a wizard to create the project and there's a class called DTE with a property Breakpoints that has all the breakpoints in it. There was also DTE.Events if I recall well to handle application lost focus event, and that's all you need besides the socket handling code. Sounds simple but you never know until you start looking at it ;)
     
  5. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Yeah, for what you say, VS sounds pretty straightforward. MD doesnt look like that, heh.
     
    Flipbookee likes this.
  6. inventor2010

    inventor2010

    Joined:
    Nov 3, 2010
    Posts:
    124
    I know a bit about plugins, and interprocess process comm (least the higher level Obj-C method of it - not so much sockets). But similarly to @Novack, I have no experience with MD plugin's, and certainly not VS plugins (I've barely even used VS).

    So, while I tend to think this isn't so simple... I'm more curious why you want it in the first place? -- It would be *kind of* cool I geuss. But, unless you do something with a second process running SI, your still going to be stuck with MD or VS running, and delegating stop and run, as well as showing the debug and backtrace info on a breakpoint, and what ever different color theme it has. So, maybe it's me, but it doesn't seem too useful.

    I for one can't even stand MD's interface, not to mention it's slow and bulky. But the few times where I *really* need breakpoints to the point where I'm willing to 'deal' with that ***, I don't feel like seeing breakpoints in SI synced with MD would be too useful since I'm going to be forced to look at MD anyway.
     
    Flipbookee likes this.
  7. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    I just quickly checked the MD Addins creation guide now and it's shocking how much more complex this is compared to VS! I don't know is it even worth looking at that given the tiny benefit I was looking for at the end, so yeah guys, I don't think anymore wasting time with MD was a good idea... Thanks for your feedback!

    The VS part still looks as quite an easy task so if anyone is willing to do that I'll gladly support that on Si3 side! If not, then I still think I'll do that by myself once I get some time for that too. I use VS with VSTU for debugging because in a project of this size and complexity Debug.Log is just not enough. Call-stacks in Si3 are often 20+ levels deep, and tracking bugs down here requires a proper debugger otherwise there would be nothing working so far :p

    I have to start working on adding debugging support in Si3 soon and I was thinking that having GUI for breakpoints might be a good starting point, although a very tiny one, but still better than nothing and good to keep high my motivation for all that ;)... Not a biggie really, so don't worry too much. The actual big task and the real challenge will be to get Mono's SoftDebugger work with Si3 ;)
     
    Novack likes this.
  8. inventor2010

    inventor2010

    Joined:
    Nov 3, 2010
    Posts:
    124
    Yeah...

    I did wonder if you were using this as a sort of "segway" into full SI Debugging...

    May I suggest a much simpler alternative? Not to throw this fully back into your block! :p

    Just to start with breakpoints, add the GUI for breakpoints to SI (no actual debugger), but use a sort of pull down window from each breakpoint's UI to select different variables to create a sort of standard debug message for. Certainly you could create a Debug.Log on your own, but it would be handy to be able to debug various values or custom strings, without actually appearing to modify the code or needing to type! :) You could make SI add it's own Debug.Log to the code at the breakpoint, procedurally generated based on whatever variables you select from a list of in-scope values to display. And then place a open and closing comment around the Debug line, so that SI's view would pre-process it out for display purposes. Then when you toggle the breakpoint, SI would remove that line of code (or comment it out) behind the scenes.

    I would think *most* of that would be needed eventually anyway, so you could always add the *real* debugger latter. I'm not sure about the hiding a line of code from the view thing... might be a bit hackish, but it's a simple one. And it'd let you develop the UI for the breakpoint's, options for them (like conditions), and a list of in-scope values, while still making a fairly simple and useful feature. :cool:
     
    mcmorry, Flipbookee and Novack like this.
  9. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Im not sure what @inventor2010 propossed is necessarily easy to implement (I can detect some issues on the proposed implementation), but it sounds to me like the ideal step towards the road of debugging, and it would definitively be darn useful!!

    I can see the usefulness of setting breakpoints and get those on the external ide sync'ed, but it still looks like a temporal and tiny feature, while the dump of variable states within Si3 would be awesome.
     
    mcmorry and Flipbookee like this.
  10. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Okay, what @inventor2010 suggests is doable, not too easy though, but that might be a really good starting point. I personally don't think that modifying the source code for logging is a good idea because that will interfere with the external IDE and it's risky if files are under source control. A much nicer solution would be to actually modify the assemblies using Mono.Cecil so if anyone has any experience with that I'd really appreciate your help! Instead of logging only this method may evolve to full debugging without actually using any help of Mono.SoftDebugger, the official library used for debugging Mono assemblies. This method, once it evolves enough, may give us full in-process debugging with breakpoints, step-debugging, step-into and step-out for editor game without need of running a second instance of Unity! That's all we actually need :) and it's exciting enough to get me learn Mono.Cecil ;)

    I'm finishing a big update today with a lot of cool fixes, intelligent code snippets, and Find in Files, so I'll be too busy to look at Mono.Cecil now... :-\
     
    inventor2010 and Novack like this.
  11. schplurg

    schplurg

    Joined:
    Mar 21, 2009
    Posts:
    208
    Can't wait to see the Find In Files feature! That is a huge one for me! Si3 will be a complete solution for me at that point. Thank you!!!
     
    I am da bawss and Flipbookee like this.
  12. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    I didn't get everything ready for the release yesterday, so I hope tonight will be the day :p
     
  13. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Actually it seems that setting your cursor in the indenting spaces and pressing ctrl-f does an auto search for the number of spaces there, that's how the 3 tabs got into my search to begin with, I did not enter them, indeed it seems you cannot type a tab in the search? (bug 1)

    The problem wasn't so much the search for spaces as the fact that I had switched focus away from my search and pressed Save and Compile... and that re-activated my search and highlighted my old query. So I didn't even know I was searching! (bug 2)

    The last inconsistency I've noticed is that when starting a search on an empty line and ONLY on an empty line it will suggest your old search. This corner case happens so rarely it feels really counter intuitive, no matter where you set your cursor before pressing ctrl-f/cmd-f it will select the nearest word or spaces as a suggestion to your search, except on an empty line where it magically suggests your old and abandoned search. (bug 3?)

    Also I think the visibility was lacking. I wonder if it would make sense to make the search bar say "<tab><tab><tab>" and/or a right click in the selected area would offer the option to clear the active search. (feature creep 1)
     
    Flipbookee likes this.
  14. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    @Flipbookee, I see your intellisense supports code comments. However not in my own code, I'm pretty sure this happens because Unity compiles without those intellisense comments, but they're invaluable! Any chance you could support them?

    Code (CSharp):
    1. /// <summary>
    2. /// This method checks if the internal state have changed.
    3. /// </summary>
    4. /// <returns>returns true if the object has changed.</returns>
    5. public bool HasChanged()
    Edit: Also adding a macro to turn /// into a full fledged wrapper for the following symbol with arguments pre-added like vs does would be nice.
     
    JoeStrout, Novack and Flipbookee like this.
  15. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Comments will be fully supported, but no, I don't have them working in my code. There are short descriptions taken from Unity Scripting Reference for Unity symbols only - you must have seen that ;)

    Auto-filling XmlDocs comments on /// is an easy thing, if I get some time tonight I'll add it to this release, otherwise in the next one...
     
    Fronne and Novack like this.
  16. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    Hi Flip,

    If you have some space left on your ToDo list, I have a request for a new feature...
    When you include a Save As button, it will be very easy to adjust an existing script and save it as a new one...
    If you still got some spare time left and it's not a lot of work, consider it... ;)

    Cheers,
    Franco Palmieri - Fronne
     
    Flipbookee likes this.
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hey @Fronne, thanks for the suggestion! I'm still trying to wrap the current update up and it doesn't go that easy as I thought. It's an amazing update and that's why I'm rushing to finish it sooner - Find in Files is a great feature but I have also fixed a tiny but important bug in the incremental parser that was sometimes messing up the line below the one we edit! Now that works perfectly :D Many other tiny bugs here and there, for example completions after implicitly typed lambda parameters were not always working, auto-suggestions were not working in many cases, generics would fail to resolve sometimes, etc...

    I got to get this out as soon as possible and then I can consider any new features ;)
     
  18. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    Can't wait for the next Update () {...} to arrive, take your time, first things first...
    It's not a big issue, I'm just getting lazy because you spoiled us... :p

    Cheers,
    Franco Palmieri - Fronne
     
  19. schplurg

    schplurg

    Joined:
    Mar 21, 2009
    Posts:
    208
    I have a request that may not be doable but I thought I'd mention it.

    I don't know how often Unity crashes for others, but for me it's fairly frequent (osx). It would be great if the Si3 scripts/tabs I was working on before the crash could be restored after a Unity crash.

    As it is with Unity by default, when ever there is a crash, upon restart it restores the state of you project as it was the last time you manually exited unity completely (non crash). Even if I'm working on"Scene A" for a week, if Unity crashes it will open up with "Scene B", as well as all the scripts, if that was what I was working on the last time I closed Unity. Sometimes Unity is so frustrating!

    As I said this is most likely a Unity issue, but it would be cool if you could solve it at least for Si3.
     
    Flipbookee likes this.
  20. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    o_O Breaking News!!! :eek:

    Script Inspector 3, version 3.0.3
    is now available on Asset Store! :D
    Main highlights of the new version:
    • Find in Files! :cool:
    • A cool new system - Smart Code Snippets :D
    • A lot of improvements, tweaks, and some bug fixes :p
    Can't wait to hear your feedback (as usual)! :cool:

    Enjoy!!! ;)
     
    Fronne, I am da bawss and mcmorry like this.
  21. FireMutant

    FireMutant

    Joined:
    Sep 2, 2013
    Posts:
    49
    @Flipbookee, sounds like a lot of fantastic new features. I just downloaded 3.0.3, but I can't find any documentation. Find in Files was easy enough, Shift+Ctrl+F, but how to use the rest of new features? :confused:

    OK, figuring out Smart Code Snippets (& User-Defined), very nice. Was going to ask for expand all, collapse all in the Find In Files, but I just noticed it is in right-click menu.

    I hope I'm not being stupid, but what is:
    "- Inspecting fields and properties of Component and derived classes for all scene objects or the one selected"

    I think this asset is the most fun to upgrade. Always lots of nice, useful surprises.

    Thanks!
     
    Last edited: Aug 26, 2015
    Flipbookee likes this.
  22. davisj16usmc

    davisj16usmc

    Joined:
    Aug 21, 2015
    Posts:
    21
    I agree with the crash restoration process that could be added in a future release, however perhaps a step above the basic on it and have it auto save the file every minute or so to prevent massive data loss if you're like me and hardly ever close Unity. :) I love Si and will definitely be upgrading!
     
    Flipbookee likes this.
  23. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Man! You're a machine. Congrats on this release.
    Tried it for a few minutes before getting back to work. Im loving it more each day!

    "Go to definition" seems to be messed up, be it in the same file or other file.
     
    Flipbookee likes this.
  24. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    I see, I forgot to mention the new features in the readme... :s Polishing everything and making sure all work on both Mac and PC starting from Unity 4.0.0 up to the latest took me a lot of time, for the last 3 days I've been doing only that...

    There's only one Smart Code Snippet included in this version - auto-generated properties for fields. To use it just start typing a field name in the same scope where the field is declared and you'll see the snippets in the auto-completion list. Once you've played enough with that, check the GeneratePropertyForField.cs in the CodeSnippets folder - it's a small C# script that handles this snippet. First thing is that it implements the ISnippetProvider interface so that Si3 will see it and it will use it. There's a enumerator method called EnumSnippets which does all the magic, and it's relatively simple. First it validates the context and does 'yield break;' if the context is not valid. If the context is valid (i.e. the insertion point is inside the body of a class or struct) this method yields one instance of the SnippetCompletion class for each available smart snippet in that scope, which in this case are two versions of a property for each field, one with getter and setter and another one with only a getter.

    Once one of those snippet gets selected Si3 will call SnippetCompletion.Expand virtual method which returns a fully expanded code snippet as a string. That's why there is a nested class called MyCompletion which overrides that method... Alternatively, if the expanded code snippet is simple enough, the Get method implementation of the ISnippetProvider can return the expanded string.

    I don't know if this sounds a bit complicated, but let me write a simple example and you'll see my point ;)
     
  25. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Whoops! I'll check that now... Thanks man! :)

    EDIT: I see... Seems like there will be another update shortly ;)
     
    Last edited: Aug 26, 2015
  26. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Si3 version 3.0.3a got just released on Asset Store with the fix for Go To Definition (thanks @Novack!) and another small one that I hope no one had a chance to notice it ;)

    Please update again! :p
     
    Novack likes this.
  27. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Here's a quick example that generates Unity's magic methods:
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3.  
    4. namespace ScriptInspector
    5. {
    6.  
    7. class UpdateMethod : ISnippetProvider
    8. {
    9.     private static List<SnippetCompletion> monoBehaviourMagicMethods = new List<SnippetCompletion> {
    10.         new SnippetCompletion("Update", "Update(...)", "void Update()\n{\n\t$end$\n}"),
    11.         };
    12.  
    13.     private static List<SnippetCompletion> editorWindowMagicMethods = new List<SnippetCompletion> {
    14.         new SnippetCompletion("Update", "Update(...)", "void Update()\n{\n\t$end$\n}"),
    15.         };
    16.  
    17.     private static TypeDefinitionBase monoBehaviourType =
    18.         ReflectedTypeReference.ForType(typeof(UnityEngine.MonoBehaviour)).definition as TypeDefinitionBase;
    19.     private static TypeDefinitionBase editorWindowType =
    20.         ReflectedTypeReference.ForType(typeof(UnityEditor.EditorWindow)).definition as TypeDefinitionBase;
    21.  
    22.     public IEnumerable<SnippetCompletion> EnumSnippets(
    23.         SymbolDefinition context,
    24.         FGGrammar.TokenSet expectedTokens,
    25.         SyntaxToken tokenLeft,
    26.         Scope scope)
    27.     {
    28.         if (tokenLeft == null || tokenLeft.parent == null || tokenLeft.parent.parent == null)
    29.             yield break;
    30.      
    31.         if (tokenLeft.tokenKind != SyntaxToken.Kind.Punctuator)
    32.             yield break;
    33.      
    34.         if (tokenLeft.text != "{" && tokenLeft.text != "}" && tokenLeft.text != ";")
    35.             yield break;
    36.      
    37.         var bodyScope = scope as BodyScope;
    38.         if (bodyScope == null)
    39.             yield break;
    40.      
    41.         var contextType = bodyScope.definition as TypeDefinitionBase;
    42.         if (contextType == null || contextType.kind != SymbolKind.Class)
    43.             yield break;
    44.      
    45.         List<SnippetCompletion> magicMethods;
    46.      
    47.         if (contextType.DerivesFrom(monoBehaviourType))
    48.             magicMethods = monoBehaviourMagicMethods;
    49.         else if (contextType.DerivesFrom(editorWindowType))
    50.             magicMethods = editorWindowMagicMethods;
    51.         else
    52.             yield break;
    53.      
    54.         var baseType = contextType.BaseType();
    55.      
    56.         var tempLeaf = new ParseTree.Leaf() { token = new SyntaxToken(SyntaxToken.Kind.Identifier, "") };
    57.         foreach (var magic in magicMethods)
    58.         {
    59.             if (contextType.FindName(magic.name, -1, false) != null)
    60.                 continue;
    61.          
    62.             tempLeaf.token.text = magic.name;
    63.             baseType.ResolveMember(tempLeaf, scope, -1, false);
    64.             if (tempLeaf.resolvedSymbol == null)
    65.                 yield return magic;
    66.         }
    67.     }
    68.  
    69.     public string Get(
    70.         string shortcut,
    71.         SymbolDefinition context,
    72.         FGGrammar.TokenSet expectedTokens,
    73.         Scope scope)
    74.     {
    75.         return null;
    76.     }
    77. }
    78.  
    79. }
    And as you can see only the Update() method is defined for classes derived from MonoBehaviour and EditorWindow, but you get the point I hope, the list of magic methods can be extended and more base type can be added ;)

    The key is in the SnippetCompletion constructor - it takes 3 parameters: the word that matches the completion, a display string used to list the snippet in the completions list, and the expanded version of the snippet. Is that simple enough?
     
    FireMutant and Novack like this.
  28. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Si3 version 3.0.3c will be available in a few minutes. I found another bug in Go To Definition, fixed now ;) Sorry! :D
     
    Fronne and Novack like this.
  29. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    I thought this was a brilliant idea, so Si3 now shows <tab>'s and <space>'s instead of invisible whitespaces when the search field is not in focus. Once you set the focus on it these will turn back to regular tabs and spaces so you can edit them :cool:
     
    Last edited: Aug 27, 2015
    UnLogick likes this.
  30. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Booo... Do you know that feeling when you think you've done something awesome and then suddenly you realize you actually screwed it up? That's how I feel now :( - someone just pointed out to me that shortcuts Shift+Ctrl+F on PC and Shift-Cmd-F on Mac are already taken for GameObject->Align With View menu command... Because, you know, the standard shortcut for Align With View is always Shift+Ctrl+F in all applications! :mad: Everyone knows that, right? Maybe there's no F in that sentence in English, but hey, there must be a language where that has at least one F...
     
    mcmorry likes this.
  31. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    So I need you help now - suggestions for another shortcut for Find in Files... I'd have suggested Shift+Ctrl+A (as in "Align" :p) if that wasn't already used in Si3, that's Select All...

    EDIT: Seems like I don't remember my own shortcuts, Select All is Ctrl+A ;) and Shift+Ctrl+A is Add Component actually :p...
     
    Last edited: Aug 29, 2015
    Fronne likes this.
  32. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Can't you just set the priority on the menu item or something... :p

    I want CTRL+SHIFT+F to be search in files. As you said it's already wired into my fingers. :)
     
  33. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    I agree with @UnLogick
    The same way you have Ctrl+S to save the code instead of the Scene when the focus is on Si3 window, can't you do the same for Ctrl+Shift+F?
     
    Fronne, Novack and Flipbookee like this.
  34. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Well, on Windows the shortcut for Find in Files takes precedence, but on OS X it doesn't unless I move the command from Edit menu to something after GameObject menu... Maybe I should move the command under the Window menu or under a new Si3 top level menu? This will make it work on Mac and for Windows I can do a similar trick as for Ctrl+S. :rolleyes:
     
    Fronne and mcmorry like this.
  35. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    I *absolutely* agree with the rest of you here, ctrl+S***f+f should be for search in files.
     
    Flipbookee likes this.
  36. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    I think is better to avoid a top level menu. We use a lot of plugins and if all of them would have a top level menu will be a serious problem.
    Inside the Window menu is fine with Si3 as a group of more commands.
     
    Fronne and Flipbookee like this.
  37. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    I think if there is an extension, that is justified to use a top level menu, is precisely Si3, which basically introduce a radically new set of features to the IDE. So if there are complains about the use of top level menus, those complains should not be pointed towards this precise extension.

    In all honestly, I think is only time until Si3 require a top level menu for its complexity and features. So in perspective, this seems pretty trivial, and if its a good option for capturing the keyboard shortcut(s), then so be it!
     
    Flipbookee likes this.
  38. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Si3 is definitely a important and high quality plugin, but on what base you define that is justified to use a top level menu?
    Every plugin developer could start thinking the same and we will all be in trouble.
    The only reason I can imaging an extension would need a top level menu is when there are many windows and tools to access that even with shortcuts will be hard to use them. And to me Si3 doesn't seem to have these needs.
     
    Fronne and Flipbookee like this.
  39. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    I dont agree.
    I think you're asking me to justify something that in fact, started from you're own subjective opinion on it, so this conversation will not thrive.

    In any case, there are some clear facts besides some mere personal opinions. For instance, there are really few casses among the thousands of editor extensions, which introduce completely unrelated features to the Unity Editor. And among those, a full blown scripting IDE, represents almost an entire new application within the current Editor. So I really easily can see the case here.

    But I insist, I have no interest on debating your personal opinion. Enough said that there are other ways to view this, and that I personally think that in not much more time, the extension will actually need of its own menu.

    Edit: grammars and typos.
     
    Fronne and Flipbookee like this.
  40. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hey guys, thanks for all your feedback! I just checked and I think putting all Si3 menu items under Window->Script Inspector 3 will be sufficient for now, but in general I agree that if an extension is big enough and unrelated enough to the rest of the Editor then it may deserve a spot in the top level menu. But that's only me, I know Asset Store staff would not agree with that even if the top level menu is as short as Si3 and it only takes about 15 pixels from the menu row :p

    There will be only a few items in it anyway, so a submenu under Window main menu should work just fine for now... I just wanted to make sure there is a global handler for the Shift+Ctrl+F shortcut - imagine for example you're running the game inside the Editor and you feel that the shooting rate of a weapon is too low... Just press Shift+Ctrl+F, type float shootingRate =, hit Enter, wait for the result, hit Enter again to open the script. Change the default shooting rate value and close the script without saving with Keep changes in memory... Continue playing the game for now - next time you enter game mode Si3 will save the changes kept in memory and recompile, so you'll get the new shooting rate :)... The point is that you don't have to open a script to get access to Find in Files :cool:
     
    Fronne, Novack and mcmorry like this.
  41. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    I agree 100%, you should avoid the the top level menu. You should think of a better way to access all Si3 commands from one spot, right now it's cut into bits. Under the File Menu the Open File & Open Any File appears, under the Edit Menu there's a Si3 folder with the Find Text command and in the Window Menu you find the Toggle Si3 Tabs. The preferences you find in Unity's preferences. Why not put the upcoming Replace Command inside the Help Menu? :p

    Serious, all commands (preferences included) in one folder, doesn't matter where, I think the Window Menu is OK but put everything at one place...

    Cheers,
    Franco Palmieri - Fronne
     
    Last edited: Aug 29, 2015
    Flipbookee and mcmorry like this.
  42. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Haha. How quickly users change from users to directors.
     
    Flipbookee and Fronne like this.
  43. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    eh eh you know... the customer is always right :p
     
    Flipbookee, Fronne and Novack like this.
  44. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    @Flipbookee, Perhaps an option in preferences could add a define that will unlock the global find in files? While I'm sure a lot of artsy people (as well as the asset store review) would be annoyed if your plugin killed the Align shortcut, it really is a bug in Unity that they assigned CTRL+SHIFT+F to something. I think I've used the align 10 or 20 times total over several years, and only when placing a camera.
     
    Flipbookee and Fronne like this.
  45. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Ah yes, an option to unlock the global shortcut for Find in Files is a great idea! Nice, I'll go with that :D - my updates bypass the standard review process, but I don't want to risk losing that privilege ;) hehe
     
    Novack likes this.
  46. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    In time, maybe an option for a centralized top level menu would be good too. Specially for those menuphobics : )

    I cant imagine the extension further elaborated (with debugging for example), and still making obscure tricks to capture the fundamental shortcuts, and having the options and commands all over the place. "Disable Top Level Menu" could be useful then ; )
     
    Flipbookee likes this.
  47. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Actually this is far too true... I'll attempt to bring this up next time I manage to get a hold of Caitlyn. Seems to me the logical solution is a "plugins" top level menu item where asset store tools like this is allowed to freely create a menu folder. Centralize the clutter to one agreed location instead of content providers constantly having this problem.
     
    Novack and Flipbookee like this.
  48. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    The real solution to this problem could be to allow the customization of the additional menu from plugins.
    Would be enough to allow to move them on top level or inside a more generic Plugins menu (not even window, edit, assets... that should contain only Unity original things). Se each developer will be free to choose what to have on top level menu.
    I have some plugins (eg. Facebook) that pretend to stay on top level menu and are completely useless there. I wish I could move them away without going to change the code.
     
    Novack and Flipbookee like this.
  49. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    @mcmorry, yes that would be great! I wish I could remove the "Visual Studio Tools" top level menu - I rarely ever use that and it takes almost a half of the menu row :p. Moreover it doesn't come with source code that I could modify and move that menu somewhere else.

    The issue with customizing the main menu is in the way how Unity deals with that - the main menu is constructed from compiled assemblies (static methods decorated with a MenuItem attribute) and there's no way to dynamically add, remove, or rearrange those menu items in Editor runtime. The only way for an extension to offer customizable main menus is then to modify its own scripts or assemblies and let Unity reload the AppDomain. Thinking about that it doesn't look like a big issue, so adding an option to Si3 to let you choose the location of its main menu items sounds like easily doable. ;)

    P.S. I just came up with a cool new extension for Unity while writing all that - one that allows you to rearrange the main menu :cool: I'm pretty sure that will be a top hit on the Asset Store! :p Anyone interested in creating that? :)
     
    Novack and mcmorry like this.
  50. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    I wish I'd have more time, but I'm so overloaded of work that I can't even think to start something new. But I'd be happy to test it :)
     
    Flipbookee likes this.