Search Unity

Script Inspector 3

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

  1. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    Minor problem: multiple displays confusion issue (Mac only?)

    Hi guys, I found an interesting, minor, problem.

    - On Mac.
    - Say you have a Mac and you are using one (or perhaps more) extra displays.
    - You launch Unity (with SI3 of course) and work away
    - You possibly quit unity
    - You remove the external displays
    - You again open that project, or perhaps another with SI3, in Unity

    SI3 often gets confused and you WON'T SEE the windows with SI3.

    ie, you double click on your script.cs, and you mysteriously do not see it - in fact the reason is it is on the "other" display (which is not plugged in).

    When this happens there is no way at all to "get back" the SI3 window!

    I did not exactly and precisely investigate the issue (I'm not sure if it happens under what exact circumstances - so, do you have to remove the extra display when Unity running, not running, etc - I'm not certain) but it's easy to repro on a Mac with external displays on hand.

    To workaround, usually if you quit and restart Unity a few times (or perhaps launch with another project, I'm not sure), SI3 comes good.

    It's interesting to note that Unity itself suffers these problems (but then, Unity is by far the most incompetent desktop app developer on the planet), they have improved it over the years but still in some circumstances you can "lose a window" in Unity, if you are messing with displays.

    Solution would probably be:

    At worst, each time open a new file, just check what display/spaces are available, maybe check for any current "lost" windows.

    (It is quite hard to get this absolutely right even in native Mac apps.)

    It's GOOD that SI3 currently respects multi-monitor positions (it would be infuriating if it did not generally remember positions on extra screens, since, most Unity users use 2+ monitors). Cheers!!
     
    Flipbookee and syscrusher like this.
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,328
    Yep, I've seen that. I agree that some way to recover these windows would be really helpful.

    If auto-detecting lost windows is hard, I'd be satisfied with a "Reset Window Positions" menu command or prefs button that simply closes all Si3 tabs and forgets the layout, so that next time you open a script, it appears in the default position. Or any other solution that's easy and reliable.
     
    Flipbookee likes this.
  3. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,002
    I've observed this problem with other undocked Unity windows, not just SI3, and I've observed it on both Windows and Mac. It's a Unity issue.

    To work around it on my own systems, I wrote a little script that runs in the editor from a custom menu item. I'm at work right now and about to leave for a medical appointment, but I'll dig up my code later and share it here. :)
     
    Flipbookee and JoeStrout like this.
  4. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    We really do need a Reset Windows button.

    For example, I'm literally "stuck" at the moment on a MacBookPro, there is literally no way to open a window in SI3 - it thinks all are on the other nonexistent monitor!

    As everyone said this is Unity's fault, but it makes SI3 unusable.

    100% of Unity engineers use many monitors, and then when you use your laptop at Starbucks, you're screwed!

    A simple totally reliable solution is just a new menu item, "Default window positions" which brings them all to a simple default on main screen. You often see this in Mac apps all the time for this reason

    ---

    Wait, here's a work-around. Find and delete ScriptInspector.dll.mdb That seems to do the trick
     
    Last edited: Oct 5, 2018
    Flipbookee likes this.
  5. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Oh really? No way, man :) that's the debugger info for the compiled DLL. Nothing to do with settings and preferences... Weird if that worked for you, I guess, something else is going on.

    I'll add the Reset Window Position command for cases like this. I'm free this weekend, so I can spend more time on Si3 and get it released by Monday.
     
    JoeStrout likes this.
  6. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    130
    how to use ctrl + c and ctrl + v ?
     
    Flipbookee likes this.
  7. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    I have problems like this all the time with multiple displays. I just reset the Layout (Window/Layout/...) and that fixes it. Might work here too?
     
    Flipbookee likes this.
  8. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Strange that you ask that :confused: ... Do they not work when you press them?
     
  9. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    130
    Nope Unity 2018.3.0.b2
     
    Flipbookee likes this.
  10. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    23
    I have the same Problem ctrl + c and ctrl + v do not work in the Unity beta versions. (I'm using 2018.3.0.b3)
     
    Flipbookee likes this.
  11. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    Hi guys, always looking to improve SI3 ...

    In this example, I started typing "OnCli ..."

    screenshot 1.png

    Notice it perfectly finds "OnClientDisconnect", that's great.

    However, it does "not know" to put in the public override void passage, nor does it put in the function default arguments.

    screenshot.png

    I believe some IDEs do in fact "know" how to do this,

    is this something we could add to SI3 ?? Help me understand!

    We heart SI3 !!!
     
    Flipbookee, Novack and JoeStrout like this.
  12. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    BTW here's a simple example of SI3 getting lost on "monitor issues"

    1. have a script on display2, let's say high on the screen

    2. sleep the computer

    3. disconnect monitor 2,

    4. wake computer

    You'll get this:

    screenshot.png

    (You can't recover from that, there's no way to grab the window and move it.)

    The current logic is probably, for each window,

    1. on awake .. which window are we? (say 2)

    2. does 2 still exist? if not put it on 1

    The logic should be (this is standard in Mac apps or anything that hosts on a mac)

    1. on awake .. which window are we? (say 2)

    2. does 2 still exist? if not put it on 1 AND limit the rect to display1 boundaries

    (at worst, just go "y not less than 50" so the top can't be lost)
     
    Flipbookee and JoeStrout like this.
  13. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    Did you try resetting the layout?

    You can save layouts for different monitor configurations and then switch to that layout when the monitor has been disconnected. Works for me.
     
    Flipbookee likes this.
  14. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    Hey flash,

    the attached image is a bug (it's a minor bug but a bug)

    When you move a window to another display, you have to check (at least!) that the y value is not less than zero. It's a basic in dealing with windows!

    * it's a good point that you can use Unity's "Layouts" menu as an emergency save, thanks, but that thing is buggy and horrible. You can also just find and delete ScriptInspector.dll.mdb as an emergency fix!
     
    Flipbookee likes this.
  15. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    Fair enough. I have this problem with all windows in Unity, even if I don't disconnect my monitor (MacOS). If I let my computer sleep and then wake it, any Unity windows that were on my second display get moved to my main display and cropped like the example in your photo.

    I find resetting the layout works fine, and as with lots of Unity quirks, I've just come to accept it as part of daily life :)

    Sorry for derailing the thread!
     
    Flipbookee likes this.
  16. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    Just BTW many mac users particularly programmers use the insanely addictive MOOM

    screenshot 1.png

    Unfortunately (surprise) Unity has never quite worked properly with it

    (since Unity's Mac programming is totally comic - obviously, Unity is easily the worst-programmed non-trivial Mac software, there is not even a second place. They literally don't know how to handle something as basic as "windows" in ordinary OSX programming - which is just .. I mean you couldn't make it up. It's hilarious. - Unity has never worked totally work properly with Moom or other screen handlers)

    , so unfortunately by inheritance SI3 doesn't work perfectly with Moom either (or the whole thing would be a non-issue, as you'd just use Moom!)
     
    Flipbookee likes this.
  17. Rocktavious

    Rocktavious

    Joined:
    May 10, 2017
    Posts:
    41
    @Flipbookee I too also have the CTRL + C and CTRL + V issue not working in Unity 2018.3

    I think this has to do with the fact that how unity provides preference options now - because you cannot open the SI3 preferences window anymore either you get the error -
    PreferenceItem is deprecated. Use [SettingsProvider] instead
    UnityEditor.SettingsWindow:OpenProjectSettings()

    So i believe the the SI3 preferences are no longer being evaluated correctly in > 2018.2 because of the changes they made to having a unified settings system.

    Let me know if i can help debug any further. I really love SI3 !!!!!! keep up the good work on it!
     
    Flipbookee likes this.
  18. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    @Rocktavious thanks for the help! I didn't know the Si3 preferences stopped working, so I think I'll fix that easily. And no, the shortcuts not working has nothing to do with that, but with an amazing thing that finally got fixed in Unity - custom Unity tabs can now handle all keyboard input before it gets handled by the main menu!!! :eek: This is great and it's the right way to process keyboard input, as now Si3 can handle even shortcuts like Cmd-S and Cmd-Z without the keyboard plugin, yay!!!

    However, Si3 wasn't made with such assumption in mind - I just thought they are never going to fix that, so now I have to adjust it to these new conditions. I tried to find a quick workaround this morning and I posted the solution here:
    https://forum.unity.com/threads/scr...est-ide-for-unity.138329/page-45#post-3758479

    That's not a perfect solution, but it let's you use the Cut, Copy, and Paste shortcuts at least. Most of the other main menu shortcuts still don't work, so I'll try to find a better fix now...

    @Fattie, @xxhaissamxx, @ElevenGame, and @flashframe sorry I missed your recent posts! I hope that quick fix works for you guys until I find a better way to fix that.
     
    Lars-Steenhoff and ElevenGame like this.
  19. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Yeah, I see what you mean. Si3 knows how to do this as well, just the way it does that is maybe a bit different. You'd have to type the "override" keyword first, then press space and you'll get suggestions to auto-generate all override method that aren't already overridden in that class. I think @Novack suggested Si3 should also handle the cases as in your example as well, and I've starting coding that up, but I never found time to finish that. I still have that here, half-finished ;) so I'll check what I can do...

    I still have no idea why is deleting the .mdb file helping the multi-monitor issue, but if that really works, just keep doing that until I add something nicer.
     
    Last edited: Oct 7, 2018
  20. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    331
    Hi, thanks for making this asset I use it all the time is it possible to turn off the auto indenting? I spend a lot of time fighting against this feature trying to format my code how I want. Especially comments which I don't want indented at all.
    I want Tabs but I want them manual when I press the tab key not when the editor thinks I might want them.

    Kind Regards

    Roy
     
    Flipbookee likes this.
  21. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Hey Roy, thank you for the compliments! :cool:

    I'll add an option to turn the auto-indenting off. Until then, please turn it off by a small change in Si3 code. Open FGTextBuffer.cs and go to line 2232, which should be the beginning of the CalcAutoIndent method. Then add at its beginning a "return null;" statement, save it, let Unity recompile the change, then try it right there in that same file - it should work the way you wanted. :)

    Let me know if that change isn't actually doing what you wanted. If it does, you're fine for now and until the next release, which I seriously hope is going to happen by Monday, then you'll have to turn the auto-indenting from the Si3 Preferences. In meantime, please remember to rate Si3 or maybe even post a small review to let the potential future Si3 users know what they've been missing out.

    Many thanks!
     
  22. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    331
    Sorry I forgot I did this post.... I've just done the line of code
    Code (CSharp):
    1.     public string CalcAutoIndent(int line)
    2.     {
    3.         // Roy stop auto indenting
    4.         return null;
    And it works great thankyou...

    I realised that as I'm subconsiously formating my code and generally shifting it around... I'm thinking and organising in my head, it helps me understand better. I really appreciate it..

    Now it's
    Code (CSharp):
    1.     public string CalcAutoIndent(int line)
    2.     {
    3. // Roy stop auto indenting
    4.         return null;
     
    Flipbookee likes this.
  23. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    331
    Just noticed a warning (had them turned off) it's no biggie unreachable code because I put a return above it
    Code (CSharp):
    1. Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs(2237,3): warning CS0162: Unreachable code detected
     
    Flipbookee likes this.
  24. Rocktavious

    Rocktavious

    Joined:
    May 10, 2017
    Posts:
    41
    Hey @Flipbookee I noticed today (when switching over to the .Net 4 runtime - getting ready for a new project that will use unity 2018 LTS) that script inspector doesn't seem to know about the extra features this brings along (EX: the new `nameof` keyword)? Is this on the roadmap of SI3 / something that will come with 2018.4 LTS when it lands later this year?
     
    Flipbookee likes this.
  25. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Yes, absolutely, I do plan to support in Si3 the newly supported C# features in Unity, because without that there wouldn't be much future left for Si3. ;) As an exercise, I just tried to support the nameof contextual keyword and I had to spend a couple of hours to make that work correctly, so adding full support for everything new in C# 6 may be quite a work for me, but I'll try to support them all incrementally, adding one or more features with every update... I've been trying to finish the next update for several weekends already, but there were too many things to do, so I hope I'll have more luck this time and get this update released by Monday.
     
    Rocktavious and Lars-Steenhoff like this.
  26. AquinasChoi

    AquinasChoi

    Joined:
    Aug 17, 2018
    Posts:
    1
    Hello, I just got Si3 yesterday, and found out there is an issue with the Korean fonts - as you mentioned, Korean characters are not monospaced.
    Has this issue been resolved, or going to be "fixed" soon?
    I can't seem to find the option, if it has been done already.

    seen in visual studio:
    vs.PNG

    seen in script inspector:
    si.PNG

    Thank you!
     
    Flipbookee likes this.
  27. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    No, it hasn’t been done yet... I just finished resolving breaking issues introduced with the latest Unity beta versions, so I’ll see now what I can do about that.
     
  28. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Can you send me the project please?
     
  29. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    411
    FB - still investigating this on my end. Could have been a false alarm! Graphics card woe. Sorry for the early alert :)
     
    Flipbookee likes this.
  30. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Crossposting from the Si3 Asset Store thread, just in case you missed that:

    Hey, hey, all you fast code editing lovers! I've got some good news for you :)

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

    Go, grab it from http://u3d.as/2ZC and don't forget to post a review if you haven't done that by now.

    This version adds only a few improvements and small fixes for the released versions of Unity, but is full of compatibility fixes for those who want to use Si3 in Unity 2018.3 beta. The changes are massive, so don't even try to use an older Si3 version with the beta - it won't work ;) and to be honest, there's more work to be done to fully support all the changes, but this release addresses the most critical ones for now.

    New in version 3.0.23:
    - Added "Edit this Editor class" context menu on MonoBehaviour-s shown in the Inspector - thanks @pdyxs
    - Added support for nameof contextual keyword in C# 6.0 - thanks @Rocktavious
    - Added Cmd-S shortcut in Unity 2018.3+ on OS X
    - Added "Reset SI Tabs Position" in the Si3 main menu - thanks @Fattie
    - Added "Save All and Reload Assemblies" to main Si3 menu as a workaround for bug in handling shortcuts in Unity on OS X - thanks @halley
    - Added "Close All SI Tabs" in the Si3 main menu workaround for a bug in handling shortcuts in Unity on OS X - thanks @halley
    - Added an option to disable the auto-indent feature - thanks @nomax5
    - Excluded code analysis on scripts in WebGLTemplates and StreamingAssets folders
    - Disabled expanding tab titles on mouseover in Unity 2018.3+
    - Fixed Unity crash on OS X on hiding tooltip windows - thanks @Fattie
    - Fixed auto-docking Si3 tabs in Unity 2018.3+
    - Fixed use of members of a type nested in a generic class - thanks @dsafew
    - Fixed error on Find All References with .Net 4.6+ - thanks @sngdan
    - Fixed freezing on auto-scroll in Unity 2018.3
    - Fixed main menu keyboard shortcuts in Unity 2018.3 - thanks @xxhaissamxx
    - Fixed Si3 popup windows stealing focus in Unity 2018.3.0b7+ - thanks @ok8596
    - Fixed closing Si3 tooltip windows in Unity 2018.3.0b10
    - Fixed a NullReferenceException on reloading assemblies - thanks @thienhaflash
    - Fixed error on reading certain assemblies in Unity 2017.3+ - thanks @JoeStrout
    - Fixed an IndexOutOfRange exception - thanks @thienhaflash
    - Fixed resolving assembly references for assemblies loaded in reflection-only context
    - Fixed error on CreateInstance<T> in Unity 4
    - Optimized reflecting all members of types defining extension methods

    Thanks to all of you who helped getting this update done!

    Happy coding :cool:
     
    Novack likes this.
  31. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,328
    Hey @Flipbookee, I've got the latest version (3.0.22), but it's still often suggesting the wrong-case version of what I'm typing:

    upload_2018-11-27_12-5-20.png

    Er. Sorry for the giant screen shot (it was taken on a Retina display). But you can see that I've typed "fixedPath" but if I hit Tab at this point, Si3 changes that to "FixedPathCreature", which is incorrect. I hate it when I'm typing correctly and the editor inserts bugs. It's an auto-break feature. This has become my only peeve with Si3, but it trips me up daily.

    Can we pretty please go further to ensure that whenever there is an exact case-sensitive match, that's the option that is selected by default?
     
    Flipbookee likes this.
  32. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    83
    Hi there, love the editor !

    I have a problem which should be happening with others as well. Since I am using the editor inside Unity, any change that I make is automatically reloading Unity classes and thus I am getting a loading spinner image all the time, which lasts for a few seconds (it's a scene with quite some objects).

    Is there a way to battle that ? Maybe an option to not automatically reload unless I save the file or so ? It basically makes editing impossible as is :/ I am using the latest macbook series btw.
     
    Flipbookee likes this.
  33. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,328
    Yes, there's an option for that.

    upload_2018-11-28_13-22-31.png

    This is how I have mine set lately, since otherwise as you say, the frequent recompiling just gets in the way when working on large projects.
     
    Flipbookee likes this.
  34. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    83
    Thanks a lot ! Also, is there a way to UNDO changes ? Seems like undo is by default undoing Unity editor changes.
     
    Flipbookee likes this.
  35. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,328
    I don't have it running at the moment, but if I imagine I'm coding, my muscle memory seems to reach for ctrl+Z to undo typing, while it's cmd+Z to undo Unity editor stuff. I'm on a Mac of course, but perhaps there's something similar on Windows? Poke around in the Si3 preferences, and you may find something there.
     
    Flipbookee likes this.
  36. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    83
    Oh I am on a Mac too, I was trying cmd+z instead. ctrl+z works ! Thanks !
     
    Flipbookee and JoeStrout like this.
  37. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    @SpyrosUn I'm sorry I wasn't around to help you with that! @JoeStrout thanks a lot for your help! :)

    Yes, Si3 on OS X uses Ctrl based shortcuts for Redo, Undo, and Save instead of Cmd-Z, Shift-Cmd-Z, and Cmd-S respectively, which is a limitation enforced by the Unity Editor on all platforms. I've found a workaround for that on Windows, so the standard keyboard shortcuts work with Si3 there, but I couldn't do something similar on OS X. Fortunately, @inventor2010 has made a plugin (the link to it can be found in the _readme.txt) for Si3 that allows handling of those three "forbidden" keyboard shortcuts on OS X and passes them to Si3.
     
  38. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Yes @JoeStrout, I'm aware of the issue and I investigated it, just I was in rush to finish all the other fixes first. I'll fix this too by Monday, I hope.
     
    JoeStrout likes this.
  39. lcs_tlf

    lcs_tlf

    Joined:
    Apr 7, 2018
    Posts:
    6
    Hello,
    I love SI3, but on all of my workstations, and across multiple projects, I am having the same issue. Where I click is not where the cursor goes, it goes to the character to the left of where I click most of the time. This is causing me much grief even though it is a simple, not feature breaking bug. Please see attached gif.
     

    Attached Files:

    Flipbookee likes this.
  40. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Okay, I see but I cannot reproduce the issue. I tried in a couple of different Unity versions and it always works as expected. Please tell me what version of Unity do you use and on what OS. Also check what font you've selected, just in case that's the reason, and I'll try to reproduce the issue again.
     
  41. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Hey, I actually think I managed to reproduce that! Thanks my friend, I'll investigate this now...
     
  42. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    Okay, I see the behavior of mouse clicks is not 100% consistent across different Unity versions and sometimes it even depends on the Si3 settings, so this will need some deeper investigation.

    While looking at that code I realized why was that done like that in the first place - because Visual Studio, believe it or not, used to handle mouse clicks exactly like that! Back then, Visual Studio was my favorite code editor (of course, since Si3 didn't exist yet :D hehe) and I wanted Script Inspector to behave exactly same like that. I wrote that part of the code back in 2012 while working on Script Inspector version 1.4 (I also just realized I've been working on this projects for 6 years and a half! :eek:) and I did that intentionally.

    Now looking again at that "feature", I really have no idea why VS used to work like that neither why I decided to add that behavior to Script Inspector too. It looks like a bug to me, so I checked that now in VS 2015 and it still looks like VS works like that at smaller font sizes o_O but not with a larger font, so I believe the mouse click events are only off by a couple of pixels in VS and I also believe that was not done intentionally.

    To sum up, I see it isn't really nice to work like that (although I'm not even noticing that as an issie in VS or Si3) and I'll get that fixed and more consistent across different Unity versions and with different Si3 settings. Thanks for reporting the issue!
     
    Novack, lcs_tlf and JoeStrout like this.
  43. lcs_tlf

    lcs_tlf

    Joined:
    Apr 7, 2018
    Posts:
    6
    Thank you for looking into it!
     
    Flipbookee likes this.
  44. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    699
    Hello,
    I am in the planning phase of a future project right now. In that project we will use C# for the core game mechanics and a scripting language (probably LUA) for special game logic. (We do that to be able to easily change / update problems of certain game elements by just downloading the fixed lua scripts on the fly).

    Anyways...
    I consider using Si3 as an editor. The question is: Is there a way to define another language? I would like to define keywords for highlighting as well as keywords for intelli-sense. It would be enough for me to define this all in a text file. I then would write my own script which parses the scripts or using reflection to find exposed C# methods. Of course: If I could use parts of Si3 to collect all the methods, it would be even cooler (but not necessary).

    Is it possible with Si3?
     
  45. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,328
    I was (briefly) a LUA fan once. Even started writing a book about it (game programming in LUA for kids). I gave it up around chapter 3, and created MiniScript instead. :p

    Not really. Si3 does come with full source code, which is clear and easy to tinker with, so you could certainly (for example) add to the keywords it recognizes. But keep in mind that Si3 is an editor extension; it doesn't work at runtime. So if I understand your use case correctly, it won't be useful to you in that way.

    (I still recommend it highly for editing your Unity code, though!)
     
  46. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    699
    I know about MiniScript and considered to use it. But although I like the syntax more and the zero based lists (instead of tables with default number-keys starting at 1) I (almost) decided to go for MoonSharp because:
    • It is free
    • It has a debugger
    • It has been tested on AOT platforms and works there for sure
    • There are a lot of tutorials. Some of them explain different ways how to do OOP with LUA (okay, you also have tutorials and also cover OOP)
    The only downsides besides some strange syntax is that it has not been updated for years. But since it is free I can test easily if it is still working with the latest version of unity.
    However, if you think I missed something important, please tell me. Also tell me, if my information of MiniScript is outdated.

    yeah, but that's actually not so cool because it would mix all languages and I would also like to have the interop functions recognized in intelli-sense (as well as script functions). This fells like a huge mess if I would put it all into the same language parser...

    No, actually that is fine. I don't want players to write scripts. I just want to update scripts on the fly if we find bugs or want to adjust balancing. So, I can write and test them in unity and upload them when they are working.
     
    Last edited: Dec 20, 2018
  47. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    83
    Hi there, merry Christmas !!!
    Quick question. Is there a way for the editor to go back to the last edited script after stopping a Play ? It stays on the Game Tab by default.

    Thanks !
     
    Flipbookee likes this.
  48. acpkm13

    acpkm13

    Joined:
    Jun 11, 2014
    Posts:
    1
    Hi Flipbookee. Good Product . A small problem that I've found is that if I use Script Inspector and it is a tab on the main Scene\Game window or Inspector then autocomplete works however if I drag it off there and it is a free floating tab or on another screen then the autocomplete stops working. Am I doing something wrong?
     
    Flipbookee likes this.
  49. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    83
    Love the editor so far, really makes my coding faster. I was wondering, are you planning to add debugging support ? I feel that this is the only thing that I am currently missing from visual studio. Everything else has been stellar so far, keep up the great work !
    Thanks !
     
    Flipbookee likes this.
  50. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,395
    @acpkm13 and @SpyrosUn,
    Thanks for your kindness! Please rate and review Si3 if you get a minute or two - that would mean a lot to me :)

    I know what you mean and I've tried to do that in the past already, but I didn't find a reliable way to make that work. I'll give it another try...

    I know about that issue and I've fixed that already (Unity 2018.3.0 opens the autocomplete popup behind the floating window) and I was hoping to get the fix released last week, but I couldn't because there were more issues introduced with the latest Unity version, so I've been fixing those up since then. There was also a fairly bad issue discovered by @JoeStrout, which took me a couple of days more to fix... I hope I'll get all these fixes released today, they just need some more testing on different platforms and Unity versions, but I think it will be all fine and a new version will be available today.

    Yes, I'm planning to add debugging to Si3, one day ;) just that's not an easy task because it works within the same process as the Unity Editor, so on hitting a breakpoint the whole process stops including Si3, which would then prevent us to do anything useful with the UI as that would stop as well and become unresponsive. However, there's a trick I've been planning to employ in order to overcome that, just implementing all that is a huge task. Still, I hope one day I'll do that too...