Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Script Inspector 3

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

  1. lcs_tlf

    lcs_tlf

    Joined:
    Apr 7, 2018
    Posts:
    6
    Hello, I have found another bug, but just a minor one (yet annoying). The c# dynamic type does not appear to be supported as far as real time error checking goes. My project compiles and runs fine, but SI3 thinks that the dynamic type is an error.

    Happy New Year,
    Trevor
     
    Flipbookee likes this.
  2. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    48
    ahh, yeah, I see what you mean. Isn't it possible to run Si3 as a separate process ? Or spawn it just for a debugging session? I guess it would only make sense that unity plugins wouldn't allow for escaping their sandbox and running a new process, but maybe worth investigating.

    Another idea would be to provide a separate "listener app" (which you can code in unity :p) that will act as the debugger and attach to unity. But yeah, this is kinda tedious.

    Left you a 5 star comment, totally deserved, thanks for a great tool !

    And thanks for looking into this anyway !
     
    Flipbookee likes this.
  3. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    570
    Under 2018.3f2.Net 3.5 the version 3.0.23.

    I have the issue, that typing in the script inspector editor not fully consumes key typing events. At typing I activate often shortcuts in Unity, like prefab goes in edit mode. Has someone this issue?
     
    Flipbookee likes this.
  4. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    Hmm, I see... The dynamic type was introduced with C# 4.0 but it wasn't supported in Unity because its runtime implementation was in .Net 4.5, so Si3 didn't support the dynamic type. Now I see, with the new .Net 4.6 runtime in Unity, the dynamic type is supported, so I'll have to support that in Si3 as well... Not in this release though - this one is an urgent patch to restore some of the Si3 features that we lost in Unity 2018.3.
     
    lcs_tlf likes this.
  5. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    Yes, that issue started happening in Unity 2018.3 and it was already reported. I fixed it, but the fix hasn't been released yet. There are more such issues caused by the massive changes in Unity 2018.3, which I've been trying to fix all in a single new version and I succeeded with all of them except one that wasn't allowing me to take a rest... So, I think I'll have to leave that one for later and release the rest of the fixes now over the weekend.
     
  6. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    Hey, hey, there's a great news for you folks!

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

    This is why you should grab it right now:
    - Made the Auto-Complete Great Again - thanks @JoeStrout
    (just kidding ;) I actually made it greater than ever)
    - Added option to disable triple-click line selection - thanks @Kougasama
    - Re-enabled keyboard shortcut hints in context menus on OS X
    - Allowed showing find/replace terms in history lists even when they contain an underscore
    - Fixed Si3 popup windows appearing behind its floating tabs in Unity 2018.3+ - thanks @ElevenGame et al.
    - Fixed opening Script Inspector Preferences in Unity 2018.3+
    - Fixed leaking typed-in characters as global shortcuts in Unity 2018.3+ - thanks @dpizzle
    - Fixed lost selection on pressing Cmd/Ctrl key while dragging mouse to select text - thanks @Kougasama
    - Fixed inconsistent caret placement on mouse clicks - thanks @lcs_tlf

    Comments and suggestions are welcome, as always.

    Enjoy! :cool:
     
    lcs_tlf and zephyr7 like this.
  7. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    48
    I have been getting this error all the time and it seems to be coming out of si3 (thankfully, it's not stopping the game from playing, but it's very annoying to have to clear the console every time) :

    NullReferenceException: Object reference not set to an instance of an object
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

    Not sure why this happens, is this a known issue ? I am attaching the full report below :

    [Exception] NullReferenceException: Object reference not set to an instance of an object
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    UnityEventBase.GetValidMethodInfo() /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:840

    UnityEventBase.FindMethod() /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:732

    UnityEventBase.FindMethod() /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:722

    MonoMethod.Invoke() /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222

    MonoMethod.Invoke() /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232

    MethodBase.Invoke() /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115

    Si3UnityEventDrawer.DrawEventListener() Assets/Plugins/Editor/ScriptInspector3/Si3 Extensions/Si3 UnityEventDrawer.cs:333
    331: persistentCallGroup = persistentCallsField.GetValue(currentEvent);
    332: var persistentCall = getListenerMethod.Invoke(persistentCallGroup, new object[] { index });
    -->333: method = findMethodMethod.Invoke(currentEvent, new [] { persistentCall }) as MethodInfo;
    335: isDefined = false;

    ReorderableList.DoListElements() /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:587

    ReorderableList.DoList() /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:412

    UnityEventDrawer.OnGUI() /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/UnityEventDrawer.cs:148

    UnityEventDrawer.OnGUI() /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/UnityEventDrawer.cs:117

    Si3UnityEventDrawer.OnGUI() Assets/Plugins/Editor/ScriptInspector3/Si3 Extensions/Si3 UnityEventDrawer.cs:279
    277: if (expanded || dummyEventField == null || textField == null)
    278: {
    -->279: base.OnGUI(position, property, label);
    280: }
    281: else

    PropertyDrawer.OnGUISafe() /Users/builduser/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyDrawer.cs:22

    PropertyHandler.OnGUI() /Users/builduser/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:139

    PropertyHandler.OnGUI() /Users/builduser/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:106

    PropertyHandler.OnGUILayout() /Users/builduser/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:208

    EditorGUILayout.PropertyField() /Users/builduser/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8791

    EditorGUILayout.PropertyField() /Users/builduser/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8775

    ButtonEditor.OnInspectorGUI() /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEditor.UI/UI/ButtonEditor.cs:23

    InspectorWindow.DrawEditor() /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1375

    GUIUtility.ProcessEvent()
     
    Flipbookee likes this.
  8. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    I don't know what's that @SpyrosUn. I've never seen that and no one else has reported that...

    I had a look at the code and I can't see where is that error happening. It's something inside the Unity Editor code.

    It may help if I find a way to reproduce this. First, I'd need to know what exact version of Unity you're using. Next, I'd need to know when is this happening. I know you said "all the time", but I'll need more details, such as is it happening while in Play mode or maybe while not in Play mode, maybe a screenshot of the Inspector tab or just explain what is the selected object when this is happening. It will be easier for me to find a repro case if you share more details with me. If you could share the project too, that would be perfect - I'd then just have a repro case as it must happen for me as well when I load it in the same Unity Editor version as you.

    Once I have a repro case, I can try to fix the issue and use that repro case to verify the fix.

    Otherwise, I would have to fix that blindly, but I don't have much options for that other than to wrap line 333 in Si3 UnityEventDrawer.cs in a try-catch clause (you could try that too, but please help me find a repro case first).
     
  9. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    48
    Oh, I actually thought it may have been a known issue. I just saw the reference to Si3 and thought it's coming from the plugin. I am basically using an asset from the store for my UI(called Hexart UI), and I notice that I get that when i collapse a tree hierarchy on the editor. Could actually have to do with the UI itself now that I am thinking about it. I'll probably take a closer look and mention it to the dev of the UI asset too. Thanks !
     
    Flipbookee likes this.
  10. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,614
    Hey @Flipbookee,

    I have updated everything on my Mac, including OS10.14 Mojave, latest Unity 2018.3 and latest script Inspector version and now each time when I Toggle script inspector tabs, the tab moves up a little to the point where the top is hidden making the scripts unusable from the cursor. The tabs also don't adhere to being within the apps section at the bottom of the Mac like other windows (including the Unity window itself works fine). Don't know if this is a bug in SI though.

    Thanks,
    jrDev
     
    Flipbookee likes this.
  11. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    @jrDev I know about this issue and I could not fix it with the last release. The get and set of the EditorWindow.position work in different coordinate spaces and I couldn’t find a way to convert the values between them. This has always been like that in Unity, but in 2018.3 it’s different in a different way, so the previous method doesn’t work here. I’d have to look inside the Unity source code to find out how to fix that and couldn’t do that in time for the last release because of the other more urgently needed fixes... I’ll see what I can do about this now over the weekend.
     
    jrDev likes this.
  12. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,614
    Awesome!

    Also, Unity is now using the shortcut SI uses for Find In Files. Is there a new way to handle this?

    Thanks,
    jrDev
     
    Flipbookee likes this.
  13. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    Oh, I didn't notice that! I mean, Unity has been using that shortcut for a while, but I was overriding that so maybe that doesn't work anymore because keyboard processing got changed in Unity 2018.3... I'll check that!
     
  14. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,614
    Any updates?

    Thanks,
    jrDev
     
  15. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    I tried everything I could think off to keep Shift-Cmd-F still assigned to Find in Files command of Si3, but without success. I've even searched the web for a possible solution and this is what I found:
    https://issuetracker.unity3d.com/is...-detected-when-menuitem-is-used-in-the-script

    I also found out that Unity 2019 is introducing a new keyboard shortcuts manager that will resolve this issue, i.e. it will allow users to reassign keyboard shortcuts as they wish. Unfortunately, this new feature is not going to be included in Unity 2018.3+ which then leaves us only with the option to reassign the Find in Files shortcut for now to something else, like Alt-Shift-Cmd-F for example (Alt-Cmd-F is also taken by Unity). I know that's not ideal, too many keys at once, so let me know if you have a better suggestion.

    Here's how to change the shortcut for now: Open FindReplaceWindow.cs and go to line 106 - you should see this code:
    Code (csharp):
    1.     [MenuItem("Window/Script Inspector 3/Find in Files... _%#f", false, 600)]
    2.     public static void ShowFindInFilesWindow()
    Then set the new shortcut you'd like to use in the MenuItem attribute, like this for example:
    Code (csharp):
    1.     [MenuItem("Window/Script Inspector 3/Find in Files... _&%#f", false, 600)]
    2.     public static void ShowFindInFilesWindow()
    Then just save that and let Unity recompile Si3...

    Another thing I want to try now is to handle the old shortcut Shift-Cmd-F in OnGUI() method, which would then, if that works, make the shortcut still available from Si3 at least, which I'd imagine is the most common way of using it. If that works, and I think it should because since Unity 2018.3 editor extensions are allowed to override main menu shortcuts, I'll release a small update this weekend.

    Regarding this issue:
    I'll to find a way to solve that too and release that as well with this weekend's update.
     
    jrDev likes this.
  16. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,614
    Hey,

    Any update on fixes yet?

    Thanks,
    jrDev
     
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    Still working on them! It's a weekend again and I'm on it right now...
     
    Lars-Steenhoff likes this.
  18. ThermodynamicsMakesMeHot

    ThermodynamicsMakesMeHot

    Joined:
    Feb 14, 2015
    Posts:
    223
    I am trying out 2018.3.5f1 with ScriptInspector and instead of its normal black background it's now this impossible white?

    Did something change or is something new needed to be clicked?
     
    Flipbookee likes this.
  19. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    I don’t know what you see, but I’ll check ASAP.... Did you maybe want to add a screenshot?
     
  20. ThermodynamicsMakesMeHot

    ThermodynamicsMakesMeHot

    Joined:
    Feb 14, 2015
    Posts:
    223
    Well maybe it's windows 10 update that caused it? I have no idea. Everything is now white.

    Unity is it's normal grey, but when looking at a script it's a blazing white background. It's doing this all versions now. So I think something windows did? Anyone else have this issue?
     
    Last edited: Feb 11, 2019
  21. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,323
    I checked with Unity 2018.3.5 and it's all normal for me...

    If you posted a screenshot that looks like this:
    VisualStudio.png

    then I'd have told you to simply select the Color Theme you used to have before the update. Select Darkula theme for example to get this:
    Darkula.png

    ...but I don't know what's going on on your machine.

    Still, if that was the case then I can't explain what exactly happened during that update. Si3 stores the selected Color Theme in Unity's EditorPrefs class which then gets saved in the Windows Registry for the currently logged in user. Sometimes, some versions of Unity do not pick up those setting from older versions (I don't know why, but I guess they have a good reason for that) in which case Si3 settings would revert to their default values. Now see, Si3 is smart and it would select a Color Theme to start with depending on whether the user is using Unity's light or dark skin, so if you, for example, ran it using its light skin Si3 would have chosen a light Color Theme. Then even if you switch to Unity's dark skin later, Si3 wouldn't switch its Color Theme by itself because it has already made the selection of a theme. So from that point on it's up to the user to select the Color Theme that fits him or her the best :)