Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Script Inspector 3

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

  1. mStep

    mStep

    Joined:
    Sep 24, 2012
    Posts:
    34
    Great update! Love the auto-braces and parameter hints.

    I'm running into an issue where the Unity color picker widow immediately closes after I open it. If I close all the SI windows, it behaves normally. I had this issue with the previous release as well. Bit of an annoyance to have to close all my script windows to select a color.

    Other than that, this release has been working great!

    EDIT: Okay i messed with it some more, it's definitely a window issue. I usually have all the SI tabs on a second monitor, with the main Unity editor on my laptop screen. Opening the color picker window does something funky to the window focus... SI seems to focus itself, which then closes the color picker window. If I move the SI tabs to the same monitor as Unity, the color picker works fine. :rolleyes:

    On OSX btw. Might just be an issue with Unity or OSX's handling of different windows on separate monitors.

    EDIT 2: Yeah it's a Unity thing. It happens when any unity tab is on a second monitor... opening the color picker focuses the tab on the other monitor, which closes the color picker. Not SI's fault! Carry on ;)
     
    Last edited: May 30, 2015
    Flipbookee likes this.
  2. radimoto

    radimoto

    Joined:
    Aug 23, 2012
    Posts:
    257
    I am testing SI3 beta 5 on Unity 5.1.0f2 on Mac OS X 10.10.3.

    I have noticed a couple of bugs. The editor window goes blank when moving the mouse up to change tabs. It does however display again when moving back into the editor window. Also the braces seems to have some minor issues, sometimes when the mouse is on the inner braces it actually selects the outer braces.

    This screenflick video shows the issues:

     
    Flipbookee likes this.
  3. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    @radimoto Dammit, Si3 looks gorgeous with Unity's dark skin!!! I wish I could see that on my screen as well :( I don't own a Pro license and your screencasts and captures are the only way for me to enjoy what I've created... Guys, please post more of these :)

    The issue with the tabs going black is something new on Unity 5.1, but it looks like an easy fix for me. I'll try to get that update quickly... Thanks for finding this issue!

    The behavior of braces highlighting was intentionally set to do that, it always finds an opening brace before the cursor that matches a closing brace after the cursor. That's why just "touching" a brace from outside doesn't highlight it... But I see this is maybe not the best choice, so I'll try to change that - thanks, great suggestion! :)
     
  4. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,783
    I like the look of this :)
    Keep at it
    Thread Watched
     
    Flipbookee likes this.
  5. DshFox

    DshFox

    Joined:
    Oct 10, 2013
    Posts:
    15
    I loved the beta 4.3 and I am loving the beta 5.
    A suggestion to auto compl. strings ( " symbol)
     
    Flipbookee likes this.
  6. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Thanks @DshFox! :D

    Do you mean auto-closing for " symbol? That should already be in Beta 5, isn't it?
     
  7. DshFox

    DshFox

    Joined:
    Oct 10, 2013
    Posts:
    15
    Yes. When you use Debug.log or GameObject.Find it doesnt auto-close(these two are the only I tested so far).
    Keep the great job man, script inspector worth every cent
     
    Flipbookee likes this.
  8. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,854
    Hey there!

    I've spent some time testing the beta 5 of your fantastic editor. I'm a hardcore code writer who uses Notepad++ right now, so you can imagine my expectations are somewhat different (lower?) than VS users :) Here is my feedback from the point of view of pure editing and usability features. Hope it is useful to you!

    Script Inspector 3 beta 5, Unity 5.0.2f1.

    - Additional / custom fonts. Personally I dislike anti-alias in fonts, as they produce additional eye strain. I use Lucida Console, which perfectly fits the crisp aliased pixels.

    As example of good aliased font, click the picture for 1:1 Lucida Console without smoothing:

    (this is Notepad++)
    upload_2015-6-2_11-54-19.png


    - Customizable themes. I've seen that themes are hard-coded in FGTextEditor.cs. Maybe you could add a way for adding custom themes (and other settings) via add-on scripting. For instance, I might create my own class containing my custom theme, and then invoke some public function in your scripts for setting the custom theme editor-wide.

    Or maybe I can just create my good ol' classic Borland theme (as in the pic above) right in your code and send it to you :)

    - Virtual cursor spaces: Allow the cursor to move freely in the editing space, even if there are no spaces, as below end of lines. The user can start typing anywhere, then that line is automatically filled with tabs and spaces up to the cursor position.


    These are my personal show stoppers:

    - Indent and braces style. Si3 forcefully puts tabs and braces using the BSD / Allman indent style. All my code uses Whitesmiths indent style (I think it provides the best readability) so Si3 is plainly unusable to me... :(

    Even if I write a line and then move it to the correct position, Si3 moves the entire line again to the forced position whenever I start typing anything on it.

    Any possibility of customizing the indent and braces style?

    - Ctrl-Tab and Ctrl-Shift-Tab: they seem to use the VS policy (ordering the tabs based on the "last visited"). This is a major annoyance when you typically switch tabs tenths of times per hour. You never know how many Ctrl-Tab hits you need for reaching some tab you're seeing in front of you. You might be editing a tab, and if you simply want to switch to the next tab, you still have to press and hold Ctrl-Tab, then watch the list, find the desired file, and hit Tab an indeterminate amount of times just to reach the tab next to the one you were editing.

    Sometimes I have to write code in Visual Studio while debugging something, or writing some native plugin. But after some time I just quit it for opening the files in Notepad++ (I'd be back later for compiling) just because of this annoyance.

    Suggestion here: an option for making the behavior of Ctrl-Tab and Ctrl-Shift-Tab immediate without popup: one hit in Ctrl-Tab immediately brings you the tab next to the one you're editing. Ctrl-Shift-Tab brings you the previous tap immediately. Both options cycles around all opened tabs.
     
    Flipbookee likes this.
  9. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,854
    Another suggestion I forgot to include in the previous post:

    - Removing the trailing blanks when saving the file (maybe as a configuration option)

    This is very useful as non-relevant spaces and tabs at the end of the lines won't trigger the "modified" flag at the version control system.
     
    Flipbookee likes this.
  10. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,713
    Hey Flipbookee,

    I love the new region selector but I have one minor issue, it is alphabetical and not listed by the position it is on the page. Is there any way you can do it that way or give an option?

    EDIT: Also can we get the ability to loop with the Find arrows? When it gets to the top and I hit the up arrow again it does nothing but I want it to loop to the last of the matching string and vice versa.

    Thanks,
    jrDev
     
    Last edited: Jun 2, 2015
    Flipbookee likes this.
  11. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Well, I'm sure it works, I just tried it now. ;)

    It actually works exactly the same as in Visual Studio, and that might be a little too restrictive. Auto-closing is active, same as in Visual Studio, only while typing at the end of a line or if all the characters to the right of the cursor are auto-inserted closing characters. Once the cursor leaves the auto-closed region the auto-inserted closing characters becomes a normal character, so after moving the cursor back inside and typing there will be no auto-close... My assumption is there was a good reason to make auto-close work like that, and without too much thinking and trusting MS engineers, I implemented exactly the same behaviour in Si3. But I'm thinking now, maybe you are right, if there's no additional " symbol in the line, maybe I can make an exception and auto-close it even if the cursor is in the middle of a line?
     
  12. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    @Edy Thanks for all your awesome feedback! It's very useful, indeed :)

    Switching between tabs is also possible with Ctrl+PageUp/PageDown - these shortcuts switch to the next or the previous tab. You can also reorder the tabs with Shift+Ctrl+Alt+Left/Right arrows, close them with Ctrl+W or Ctrl+F4, duplicate them with Ctrl+T, and toggle-maximize them with Alt+Enter :D

    Customizable themes are planned already. If you happen to make you favorite theme just sent it over to me and I'll include it :) I've been also thinking to make it easier to add custom fonts, but I still haven't found an easy enough way how to do that. "Easy" from user's perspective, I mean... Anyway, you can turn on Font Hinting to make the fonts less anti-aliased, and if that's not enough you can change the settings for each of the included fonts and set Rendering Mode to Hinted Raster, although I don't know how good would that look with these fonts.

    Virtual cursor spaces can be easily added. And also additional auto-indent styles. I started the current implementation of the auto-indent behavior only as a quick test, and I know it isn't perfect, but I have an idea how to make that much more efficient, more correct, and even customizable. The funny thing about this is that the new method will also be simpler to implement :p

    Removing trailing spaces on save is really easy to add. I personally hate those, and I don't know why I didn't think about that option?

    Thanks again for your great feedback!
     
  13. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    @jrDev Yes, it is possible to list regions in the same order as they appear in code. So, I'll add that as an option, and looping for searches as well :cool:
     
  14. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    @radimoto and everyone else using Unity 5.1 beta:
    Please disable "Si3 tabs titles - Expand on Mouse-Over" option in Preferences->Script Inspector->General tab until I send you the fix ;)
     
  15. jQu8ry

    jQu8ry

    Joined:
    May 28, 2015
    Posts:
    1
    hi there~ i'm always thanks for you
    um,, now i'm really want to know when i can use auto code completion
    or how i can test Si3?

    i'm really wanna use c# auto code complete :-(
     
  16. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    @jQu8ry I'll PM you in a minute :)
     
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Smooth scrolling in Si3 :cool:

     
    Callski and The-Spaniard like this.
  18. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
  19. inventor2010

    inventor2010

    Joined:
    Nov 3, 2010
    Posts:
    124
    Your reward will be when, in time, after enough people have learned of it, and probably after SI3 is out, that more and more people entering such things will be using SI! :D

    Besides, always this one:

    NEW! Asset Store Award – For the first time, we’re specifically calling out Asset Store submissions that have been released in the last year. These can be anything from particle packs to full editor extensions.

    PS. Sorry I haven't stayed around (surgery).
     
    Flipbookee likes this.
  20. FireMutant

    FireMutant

    Joined:
    Sep 2, 2013
    Posts:
    42
    Hi Flipbookee,
    I have a request for a feature. I'm not sure if it is possible, but I'll ask anyways. I would love to be able to hide/show the SI3 window with a hotkey. It is awkward to move it out of the way after each compile to test my game and then "find" it again to drag it to a position where I can continue to edit my code. If I could press a hotkey, hide SI3, test my game, then press the hotkey again to show SI3 in exactly the same place and continue editing, it would be a HUGE time saver and convenience.

    Thanks for your consideration.
     
    Flipbookee likes this.
  21. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Well, I always have all my SI tabs docked to the same group of tabs as the Game tab. And I don't have to save, compile, and move or switch tabs - Ctrl+P does all that for me. That's Unity's shortcut to enter editor game mode, Si3 recognizes the command, saves all the modified scripts, Unity compiles them, and if everything went fine (without any compile errors) Unity reloads the assemblies, moves the focus to the Game tab which then hides all the SI tabs behind it, and game starts.

    Now I know this is not exactly what you're asking for, but I am not sure are aware of this option? I think this is much faster and more convenient workflow. Anyway, if this is not what you want I guess I can easily add a shortcut to toggle show and hide all SI tabs.
     
  22. FireMutant

    FireMutant

    Joined:
    Sep 2, 2013
    Posts:
    42
    Thanks for the quick reply, as always! You are correct, I was not aware of the Ctrl-P shortcut, so I gave it a try. I can use it as a partial solution. The issue for for me is that none of the tabs in my preferred layout utilize that much screen space and I prefer my code window to be as large as possible (I'm old and can't see as well as I used too! ;)), so I use a LARGE floating window. I agree if SI3 is docked, this feature is not necessary, but for those who need SI3 to cover most of their screen :oops:, it would be extremely helpful.

    I fully understand if you don't feel this feature is useful to enough users to justify implementing it.

    I made up a quick work around by saving 2 different layouts, one with SI3 big, and one with it really small in the corner and adding a custom menu item to toggle between the 2 layouts, but it is far from a graceful solution. Thanks for making me aware of the Ctrl-P shortcut.

    EDIT: If there is an exposed method I can use to show/hide the SI3 window, I can write the menu shortcut myself. I browsed the code, but have no idea how to address the main SI3 window.
     
    Last edited: Jun 5, 2015
  23. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    No, there's no method to do that. Each Si3 tab is a native Unity tab and the floating window that contains all those tabs is not something I made but it comes from Unity. All Si3 tabs are instances of FGCodeWindow class which extends EditorWindow class and therefore inherits the Close() method, and closing them is easy but you'd also want them to restore their position on screen, scroll position, cursor position and selection when they reappear.

    I'm trying to say that this is not as trivial as it may look like, but I'll try to do something about it for the next update. My main focus is on extension methods now, so let see first how's that going to go ;)
     
  24. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    @FireMutant, guess what? Alt+T now toggles visibility of all floating Si3 tabs :D

    @Novack Si3 now remembers the position of the last closed tab and the new ones will appear there ;)

    @ZimM Si3 just learned how to handle this special rule of the C# language specs:
    https://msdn.microsoft.com/en-us/library/aa691354.aspx
    so that now that MSDN example is all correctly recognized:

    IdenticalNames.gif
    - Reference highlighting is on the field Color. The struct Color and the variable Color are not highlighted.
    - Semantic highlighting also sets different font colors for types and fields/variables.
    - The context in which Color is used determines its meaning. :cool:

    Just for the records, the same code snippet in MD is all messed up :p

    MDFail.gif
     
    Novack, FireMutant and Callski like this.
  25. The-Oddler

    The-Oddler

    Joined:
    Nov 26, 2010
    Posts:
    124
    Daaamn Flipbookee, SI3 really is awesome! It got me through some hard monodevelop times :p No better editor on mac. On Windows I'm now also trying out vs, but still have SI3 in all my projects, for quick changes via the inspector.

    One of my favourite features people might not know about: You can have different settings in the inspector, and in popout windows.
    So in the inspector I disable my line numbering, and don't track changes , so less space is wasted there. Yet in the popout windows all those things are still useful, and there is space enough.

    Thanks man, awesome stuff!
     
    Flipbookee likes this.
  26. Callski

    Callski

    Joined:
    Feb 3, 2013
    Posts:
    130
    SI3 is awesome! I know I have posted this before, but are you working on displaying comments for different methods/classes? It would be awesome to be able to hover over different methods and read some of the comments I've written like in VS. Also, I think this is pretty much ready to go on the store at $80. I think posting it for anything less than that discredits the amount of hard work you have put into this product. $35 is a complete steel for something this feature complete! Script Inspector is really awesome.
     
    Flipbookee likes this.
  27. Callski

    Callski

    Joined:
    Feb 3, 2013
    Posts:
    130
    Forget my comment about displaying comments on mouse over. I updated to the latest beta and I'm seeing my code comments appear when I hover over different methods!! So cool!
     
  28. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Wait, what! :) I haven't done that yet and it's only there for Unity API :p :D
     
  29. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,713
    More betas pretty please?!

    ;)
     
    FireMutant and Flipbookee like this.
  30. Callski

    Callski

    Joined:
    Feb 3, 2013
    Posts:
    130
  31. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    718
    Awesome.

    Man what can I say? Is simply incredible what you have done with Si. The level of dedication and engineering behind it, is beyond any expectations. Congrats, and please keep it up!


    I cannot see the same than Callski in the above screenshot, Im using Unity5:


    And btw, I'd like to have the standard hint colours in monokai.

    A couple of requests that come to mind:
    * Search text in project.
    * Some parameter hints love.
    * Would be nice to have hints/context help on the autocompletin list selected element.
     
    Flipbookee likes this.
  32. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Thank you all for your lovely comments! :D

    @Callski Right, that's what I meant, Si3 is only showing that short info for Unity API symbols. You're right, we need something similar for our own code as well. That would be awesome, but I can only think about that after the release. ;)

    Thanks for that beautiful screenshot! :D

    @Novack Your build target must be the Web Player if you don't the symbol info. I've disabled it because the dictionary object that holds all the symbols and their info was probably too big in this case, it was crashing Unity 4 and it works in Unity 5 but it was taking several seconds to initialize. There's something weird with that build target, I can't explain... I'll try to put the initialization on a background thread, maybe that will help.

    What do you mean by "the standard hint colours in monokai"? I agree with the rest of your suggestions, just I'm not sure do we have the same things in mind about parameters hints?

    @jshrek Your idea to ping in red the last occurrence when searching text works great, especially when it's combined with looping through search results :cool:

    @jrDev Did I mention that regions are now listed in the same order as they are in code by default, and there's an option to sort them alphabetically, just in case ;)... I've reduced the parsing time by 10-15% more while implementing that feature - I've found a "TODO: Optimize this!" block

    I'll have to shorted the current update a little bit and let the extension methods wait for the next one. Unity 5.1 is already out and you'll need this update for that, so yeah - more betas :p
     
    FireMutant likes this.
  33. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    718
    Heya mate!

    Oh I see, yes indeed, Im using WebPlayer build target. So there are things pending to solve on that? That build target has a few other penalties (not just for your extension). I hope it works at some point, I use it a lot.

    On the parameter hints love, I mean at least two things:

    1) Parameter hints showing up on this situation:

    So, while navigating the options, we can also check the parameters AND the API reference of the selected dropdown list element. This is great for when you're not sure what you're looking for.

    2) Corresponding parameter to be highlighted on the hint (and reference for it displayed), as you write/traverse the code. This helps when the method has a lot of parameters, or when a parameter is of a type you cant identify on your head, so the reference for that type on the hint would help.

    And finally, by the colour I mean I usually prefer the hint tooltip colour and font to remain the standard, despite the theme of the editor. I guess I can hack away that myself, but meh, I can always ask for pet features, like an option for that, hehe.


    This looks very very well, and Im only missing the search in project functionality (besides debugging), but most of the time I dont leave Unity any more. Outstanding Dejan, outstanding!
     
    Last edited: Jun 10, 2015
    Flipbookee likes this.
  34. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    718
    Oh, another one: navigation buttons.
    "Go to Definition", "Search", and incoming "search in project" features usually result in jumps from current line location to some other place in code.

    So a "back" and "forward" buttons in the toolbar would be really handy.

    Edited for clarity.
     
    Last edited: Jun 11, 2015
    Flipbookee likes this.
  35. FireMutant

    FireMutant

    Joined:
    Sep 2, 2013
    Posts:
    42
    Does this mean we should not be upgrading to Unity 5.1 until you release the next beta?

    Thanks.
     
  36. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    You can upgrade but you'll have to disable "Expand on Mouse-Over" option in the Preferences like this:
    Unity5.1.png

    Some of the internal/private variables disappeared in Unity 5.1 so Reflection fails to find them and then Si3 spawns exceptions. Disabling this option "fixes" the issue, so use that please until I get the update ready :p
     
    FireMutant and Novack like this.
  37. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,713
    Hey flipbookee,

    This is a small request and I only noticed when I was trying to code something yesterday. When I am writing code within quotes " " I would like to be able to have SI automatically add a plus/open/close quotes when I put the code on a different line. So for e.g.

    Debug.Log("I want to test this " +
    "out to see if it works");

    I think Monodevelop does this for you too.

    Thanks,
    jrDev
     
    Flipbookee likes this.
  38. inventor2010

    inventor2010

    Joined:
    Nov 3, 2010
    Posts:
    124
    Noticed what could be a bug, I haven't pinned down whether it happens with older versions of SI or on my other computer running Unity 5, but it's fairly repeatable.

    I'm trying to write a script for serial com using SI, and fairly frequently it crashes all of unity (about every 3rd time or so I change something and re-compile). Particularly if I edit the script, don't save, and click run.

    Note: I had to enable .Net full in player settings (not subset) to get System.IO.Ports, so that may be part of it.

    Bad Script:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.IO.Ports;
    4.  
    5. public class main9DOF : MonoBehaviour
    6. {
    7.     SerialPort stream = new SerialPort("/dev/tty.usbserial-A8007Up2", 115200);
    8.    
    9.     void Start()
    10.     {
    11.         stream.Open();
    12.         stream.ReadTimeout = 10000;
    13.     }
    14.    
    15.     void Update()
    16.     {
    17.         if(stream.IsOpen)
    18.             Debug.Log("yay!");
    19.         else Debug.Log("crap");
    20.        
    21.        
    22.         byte tmpByte;
    23.         string rxString = "";
    24.        
    25.         tmpByte = (byte) stream.ReadByte();
    26.        
    27.         while (tmpByte != 255) {
    28.             rxString += ((char) tmpByte);
    29.             tmpByte = (byte) stream.ReadByte();
    30.         }
    31.         Debug.Log(rxString);
    32.     }
    33. }
    34.  
    It may help to have something on a com port to listen to, and I'm still coding this, so it doesn't work right, but just a heads up.

    Specs:
    Macbook Pro 17" 2009
    Unity 4.3.2f1
    SI Beta 5 (just downloaded 10 minutes ago from the last link you sent me)
     
  39. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    @inventor2010 Thanks for the heads up! I'm trying to repro that, no luck so far. Can you maybe dig out the Editor.log and send it to me?

    @jrDev Done! :)
     
  40. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    718
    I will have to ask again for the infinite loop when using search. Stoping at the last ocurrence is quite uncomfortable. Does any editor actually does that by default? Anyway, at least give me the option, but I think that the counter of finds besides the input is more than enough.

    (Using Si3 everyday as the main editor, so exuse me for the flux of details and feedback.)
     
  41. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Too late, I've done that already! :p

    That's why I had to add smooth scrolling too. I hate it when in other editors I have to look at the scrollbar when I search for next result only to see is it moving down or up, but now with smooth scrolling I can keep my focus on text.

    Keep your feedback coming, please :)
     
    Novack likes this.
  42. inventor2010

    inventor2010

    Joined:
    Nov 3, 2010
    Posts:
    124
    I think I have to apologize on my last comment. I was assuming the error was in regards to SI because Unity fails on saving and compilation. But it appears the issue may lay with Mono's support for the SerialPort class in older Unity versions. I tried this on my newer computer (running Unity 5) and it seems to have been fixed.


    As a side, I could still ask for about a dozen or so settings, auto brace completion on/off for one (i'm constantly righting code, and then nesting it). But since your kinda a 1 guy op, have you considered making settings a sort of rolling list rather than hard coded? It makes it so much easier if you want to add an option for something. I did that at my day job and it has saved me hours, maybe days of GUI layout (lots of settings). You simply right a framework where your settings class implements something like "SettingForKeyPathDefultingTo();". The setting's class maintains a list of keys and uses those to procedurally generate a tree UI (or a simple list if you prefer setting names only, without categorization). Then upon calling "SettingForKeyPathDefultingTo()" it returns the setting in memory if it exists (changeable in the UI), and otherwise: updates the tree with the new key, sets it to the default value passed which would just be an object (containers of course for basic types), and returns the default value. The UI is of course coded to support several basic types and assert on others, but, thinking back, Unity makes that part easy doesn't it (property drawers)? :)... That basically lets you add settings for anything you want though, with only 1 line of code! Only thing is, you have to be careful if you need a setting in multiple classes to give the same default, and make sure to call it frequently enough to stay up to date, but not excessively.

    I thought about doing this before, but figured I'd ask, cause I'm not sure how well this may work for your code. But it'd be a nice easy way to please everyone sort of speak (least as far as options go). ;)
     
  43. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Yeah, I do the same, first I write my code and then I nest it, so I was thinking already how to improve that. I have some ideas but I'd love to hear first what do you guys think may be the ideal solution for that?

    @inventor2010 Take a look at my SISettings class, that's something very similar to your approach. All it takes for me to add a new option is one line of code to define it and one line to draw its GUI. :) I saw something similar while I was browsing UnityEditor code and I liked it, so I did something very similar. :)

    In your case it sounds like options are identified by string keys and each time you read the value you'd have to specify the default, right? That's what I wanted to avoid actually, strings are sensitive to typos (don't look at my CSGrammar class, please :p string keys are everywhere) and I wanted it to be easy for me to change the default if I want to.
     
  44. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,713
    Thanks! Where is my new Beta!? :p

    Thanks,
    jrDev
     
  45. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    He he, yeah, it's coming. :p I'm trying to wrap a new feature up. At some point while fixing some stuff I started to miss Go Back/Forward very badly, and (stupid me) I thought that will be an easy thing to add. Then once I started that I thought it would be pity to leave it half-finished... Now I'm almost done with that... It feels so relieving to be able to quickly jump to previously visited locations and come back, that I'd hate to not share this with you guys!!!
     
    mStep and Novack like this.
  46. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Hey, I'd also like to get my hands on the beta since I have a mac now and am unable to use VS :)
     
  47. Callski

    Callski

    Joined:
    Feb 3, 2013
    Posts:
    130
    Have you checked into Visual Studio Code? It's free for mac. To set it up, link Unity to Visual studio on your mac(Top menu bar --> Unity --> Preferences --> external tools). Then Unity Top Menu bar -->Assets -->SyncMono. In visual studio code on the very bottom you'll see an icon that looks like a flame. Click it and select your unity .sln file. Boom now you've got code recognition! I still prefer to use code
     
    BYD likes this.
  48. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    718
    Hey @Flipbookee, another pet feature from the Novack's collection, hehe:

    Whenever I type ";" and is not in a string context (not inside " "), then put the semicolon at the end of the line, and the caret too.

    This one comes from MD, and is great for quickly closing a line after an autocompletion of parenthesis.
     
    Flipbookee likes this.
  49. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Thanks, I'll try it out! ;)
     
  50. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,426
    Cool, I'll message you in a minute! :)

    Did you try using VS Code? I'd love to hear how does that compare to other alternatives and also Si3 once you get your hands on it.

    @Callski, I'd love to know about your thoughts of it as well :)
     
unityunity