Search Unity

Advanced Inspector - Never Write An Editor Again

Discussion in 'Assets and Asset Store' started by LightStriker, May 4, 2014.

  1. rosevelt

    rosevelt

    Joined:
    Oct 23, 2012
    Posts:
    47
    Hello,
    I'm not sure if I'm doing something wrong but when inspecting a method,
    If there is an exception while invoking it through AI it appears that the call stack is only for the inner parts of AI.
    Can we have a full callstack for the actual method implementation?

    Thanks for a great product
     
  2. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    The invocation of anything outside the AI is encapsulated in some try/catch, otherwise the AI could fail to draw beyond the point where the exception is thrown. Usually, the message should give you the exception thrown by your method, but I know the Debug.LogError won't give the callstack towards it.

    I'll investigate how I could retrieve the callstack and display it.
     
  3. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    Hey, i can't get a collection to be updated / initialize without closing / expanding it. I tried to use the "IDataChanged" but when i call OnDataChanged i get:
    "NullReferenceException: Object reference not set to an instance of an object"

    My class:
    Code (CSharp):
    1. [AdvancedInspector]
    2. public class QuestViewAdminComponent : QuestViewAdminComponentBase, IDataChanged
    and code:
    Code (CSharp):
    1. this.OnDataChanged();
    2. Debug.Log("Called OnDataChanged");
    The class QuestViewAdminComponentBase is extending Monobehavior. Is there something else i need to do?
     
  4. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    There's nothing else to do, so there's obviously a bug.

    Do you think you could package me a stripped project where I could reproduce it?
     
  5. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    i use viewComponent from uframe and it seems that is the problem, i tested the example page 2 and it works.
    The component is extending Monobehavior:

    Code (CSharp):
    1. public class QuestViewAdminComponent : QuestViewAdminComponentBase, IDataChanged
    2. public class QuestViewAdminComponentBase : uFrame.MVVM.ViewComponent
    3. public abstract class ViewComponent : MonoBehaviour, IBindingProvider
    So i though this would work. The rest of AdvancedInspector seems to work fine with it. Its a bit difficult to send you just a piece because of uframe, but there is a free version and the source code here: https://github.com/InvertGames/uFrame

    The viewComponent code is here: https://github.com/InvertGames/uFrame/blob/1.6/MVVM/Views/ViewComponent.cs

    Those might give you an idea of why it doesnt work. Is there another way i could force the inspector to refresh the list ?

    Thanks for your help!
     
  6. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    97
    Is there a way to make collections use a property or member to display as label instead of the index number?



    e.g. Instead of "[0]" and "[1]", display the value of member "Name"; "Test 1" and "Test 2". Similarly to the "Descriptor" Attribute.

    EDIT: I'm stupid. Overriding "ToString" does the trick. Although the indices are still being displayed. Is there a way to optionally hide them?
     
    Last edited: Sep 1, 2015
  7. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    I (accidentally) opened the watch window and this error is happening apparently every frame, freezing the window:

    NullReferenceException: Object reference not set to an instance of an object
    AdvancedInspector.WatchWindow.OnGUI () (at c:/Users/LightStriker/Desktop/AdvancedInspector/AdvancedInspector 5/Lib/AdvancedInspector/AdvancedInspector/Watch/WatchWindow.cs:138)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  8. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    You cannot "hide" them, but you can bind the index to an enum. (See the Collection Attribute or the "Enum Bound List" example in Example7_Collection)
     
  9. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Do you have any way to reproduce it? What is your Unity and Advanced Inspector versions? How did you open it?

    By the way, I don't always get notified when someone reply to this thread, so if I'm not answering, contact me directly to admin@lightstrikersoftware.com.
     
  10. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    I think it was 1.57 but I'm not sure. Is there a way to check? I'm pretty sure I pressed CTRL-K and it opened, though something may have been not working correctly because after that CTRL-K opened some other window that it wasn't suppose to. I just upgraded to Unity 5.2. In any case, I haven't been able to reproduce it but I thought the information given would be enough to add null checks for things on that line.
     
  11. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Sadly, it's not that simple as the code line 138 in my current source is;

    Code (CSharp):
    1. GUILayout.FlexibleSpace();
    As you can see, not much null check to add there. So I could assume the code changed between the version you are using and the one I'm working on.

    A bug I found out is when some window are opened while the code is being reloaded - visible by the spinning loading icon on the bottom right. While it's reloading, the shortcut at all messed up. For some reason, I had totally unrelated window open while using shortcuts that were not assigned to them.

    Otherwise, without a way to reproduce the issue, I have very little chance of fixing it. In the current version, all the variables are null-checked.
     
  12. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    I'm thinking that's what happened to me.

    Totally understand. Sorry for the premature "bug report". Thanks for the fast response though! :)
     
  13. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Always better to report it... Makes me double check, which is never a bad thing.
     
  14. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    97
    Binding the index to an enum determines the size of collection. We need something more dynamic. The ToString approach is nice, just need an optional way of replacing the index with a given property and/or make it work the same way as ToString.

    Another use for this would be displaying custom names for dynamic collections using the DropDown display mode for custom classes, giving collections a more descriptive name.
     
    Last edited: Sep 11, 2015
  15. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Duly noted for the next version.
     
    XaneFeather likes this.
  16. TurboNuke

    TurboNuke

    Joined:
    Dec 20, 2014
    Posts:
    69
    Hi,
    Just to let you know that the current version doesn't compile on the Windows Store platform on 5.2. Will you be fixing this, or should I attack the source with my own #if PLATFORM_METRO code?
     
  17. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Good morning,

    I don't have Windows 8. Unity doesn't appear to show any error when I switch to that platform, but it's probably because I lack Win 8. Do you have the error of compilation?
     
  18. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Note that I'll be at Unite Boston next week, so if you have any question you wish to ask me in person, that can be arranged.
     
  19. Mithion

    Mithion

    Joined:
    Dec 12, 2013
    Posts:
    14
    I'm having an issue with the default Hinge Joint component - when I enable Limits in the editor and then try to expand the limits collection, I get the error :

    NullReferenceException: MemberInfo cannot be null in an InspectorField field constructor.

    Is there a known fix for this? I'm using version 1.57.
     
  20. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    The easy solution is to go in menu Edit > Preferences... > Adv. Inspector > Editors and to disable the HingeJointEditor.

    The bit harder solution is to open the file JointLimitEditor.cs and replace its content with;

    Code (CSharp):
    1. using System;
    2. using System.Reflection;
    3.  
    4. using UnityEditor;
    5. using UnityEngine;
    6.  
    7. namespace AdvancedInspector
    8. {
    9.     [CanEditMultipleObjects]
    10.     [CustomEditor(typeof(JointLimits), true)]
    11.     public class JointLimitsEditor : InspectorEditor
    12.     {
    13.         protected override void RefreshFields()
    14.         {
    15.             Type type = typeof(JointLimits);
    16.  
    17.             fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("min"),
    18.                 new DescriptorAttribute("Minimum", "The lower limit of the joint.", "http://docs.unity3d.com/ScriptReference/JointLimits-min.html")));
    19.             fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("max"),
    20.                 new DescriptorAttribute("Maximum", "The upper limit of the joint.", "http://docs.unity3d.com/ScriptReference/JointLimits-max.html")));
    21.             fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("bounciness"),
    22.                 new DescriptorAttribute("Bounciness", "Determines the size of the bounce when the joint hits it's limit. Also known as restitution.", "http://docs.unity3d.com/ScriptReference/JointLimits-bounciness.html")));
    23.             fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("bounceMinVelocity"),
    24.                 new DescriptorAttribute("Bounce Min Velocity", "The minimum impact velocity which will cause the joint to bounce.", "http://docs.unity3d.com/ScriptReference/JointLimits-bounceMinVelocity.html")));
    25.             fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("contactDistance"),
    26.                 new DescriptorAttribute("Contact Distance", "Distance inside the limit value at which the limit will be considered to be active by the solver.", "http://docs.unity3d.com/ScriptReference/JointLimits-contactDistance.html")));
    27.         }
    28.     }
    29. }
     
  21. mdlp

    mdlp

    Joined:
    Sep 15, 2015
    Posts:
    2
    Hi, I see back in may that this was already reported, and was wondering whether a solution was likely to become available soon. I get many repetitions of the following warning:
    Code (csharp):
    1.  
    2. GetUseConeFriction always returns false. Cone friction is no longer supported, see getFrictionModel instead
    3. System.Reflection.MonoProperty:GetValue(Object, Object[])
    4. AdvancedInspector.InspectorField:GetValue(Object)
    5. AdvancedInspector.InspectorField:get_Descriptor()
    6. AdvancedInspector.AdvancedInspectorControl:DrawLabel(FieldEditor, InspectorField, Boolean)
    7. AdvancedInspector.AdvancedInspectorControl:DrawNode(InspectorEditor, InspectorField, Boolean, Boolean)
    8. AdvancedInspector.AdvancedInspectorControl:Draw(InspectorEditor, InspectorField, List`1, Boolean, Boolean, Boolean)
    9. AdvancedInspector.AdvancedInspectorControl:Inspect(InspectorEditor, List`1, Boolean, Boolean, Boolean, Separator)
    10. AdvancedInspector.AdvancedInspectorControl:Inspect(InspectorEditor, List`1, Boolean, Boolean)
    11. AdvancedInspector.InspectorEditor:DrawAdvancedInspector()
    12. AdvancedInspector.InspectorEditor:OnInspectorGUI()
    13. UnityEditor.DockArea:OnGUI()
    14.  
     
  22. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Right now, you can ignore this; it's only a warning of a deprecated field. The next version has this fixed. If you wish, I can send you the current beta.
     
  23. Mithion

    Mithion

    Joined:
    Dec 12, 2013
    Posts:
    14
    Thanks very much! Exactly what I needed.
     
  24. mdlp

    mdlp

    Joined:
    Sep 15, 2015
    Posts:
    2
    I think I would like this--I figured it was harmless, but it is very distracting and fills the console with warnings such that I can't see the info I actually wish to see.

    Thanks very much!
     
  25. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Well, I have to say that Unite Boston is awesome so far. :)
     
  26. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    97
    Is there a way to disable the Add/Remove buttons on collections? I have a collection that I'm feeding by code and only want the user to be able to remove entries manually but not add them.
     
  27. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Yes, easily. You should check the AIExample7_Collection example class.

    If you set the Collection attribute "Size" property to 0, it assumes the collection's size is handled internally by your code.
    If you set it to any number above 0, the inspector will automatically resize the collection to that number.
    Those two behaviour hides the +/- controls.

    Any negative number, and it's the default behaviour.
     
  28. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    97
    Ah thanks, it seems to work with lists!
    Sadly doesn't seem to work on Dictionaries. Is there an explanation for that? Maybe I did something wrong; here is my setup:

    Code (CSharp):
    1. [AdvancedInspector.Group("Active Instances", Expandable = false, Priority = 1)]
    2. [AdvancedInspector.Collection(Size = 0)]
    3. [AdvancedInspector.DisplayAsParent()]
    4. [AdvancedInspector.Expandable(true, true)]
    5. [AdvancedInspector.DontAllowSceneObject()]
    6. [AdvancedInspector.NoPicker()]
    And here is the result:
     
  29. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    The collection attribute have never made to work with the Dictionary - for now.
    What kind of feature should be implemented in the dictionary?
     
  30. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    97
    I'm not sure. Having a separate attribute for controlling the add/delete buttons and/or adding these into the Collection attribute would be sufficient for now. Also, personally, I would love a way to hide the index identifier, e.g. [0], from collections and/or replace them with a custom string.

    Now I'm having another question. I want to display a list of read-only labels residing in a group. First, I tried a simple approach of creating a collection of strings, but there seemed to be no way of removing the edit-box of the right side (though I am well aware of the ReadOnly attribute). Now, I tried a different approach of writing an InspectorEditor and overriding its OnInspectorGUI to manually draw several EditorGUILayout.LabelFields but I am wondering if it is possible to combine that with manually drawing AdvancedInspector elements like the Group control?

    Also, when overriding RefreshFields(), the GroupAttribute in InspectorFields seem to be ignored.
     
  31. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    It is possible to override the index of a list with the Collection attribute by binding it to an enum. Otherwise, if you want to display information about the current item of the list, you should override the ToString method. It doesn't get rid of the index, but display that string to the right.

    I'm not sure what you mean by read-only label? Have you tried the Help attribute, or the Title attribute? Or you can do something similar to the AIExample_Method9 example with the invoked method;



    Code (CSharp):
    1.     [Inspect, Group("Invoked Method"), Method(MethodDisplay.Invoke)]
    2.     public void MyInvokedMethod()
    3.     {
    4.         GUILayout.Label("This was drawn from an invoked method.");
    5.     }
    6.  
    7.     [Inspect, Group("Title"), Title(FontStyle.BoldAndItalic, "It's a title")]
    8.     public int aValue = 0;
    9.  
    10.     [Inspect, Group("Help"), Help(HelpType.None, "This is a help box")]
    11.     public float aFloat = 0;
    When overriding the RefreshFields, you have to "build" your InspectorFields structure yourself. You can see an example of making groups within the CameraEditor.cs file. You lose all the sorting/grouping the AI does, but you gain the ability to place stuff wherever you want. This method of thing only exist so I could override Unity's editor properly, since their classes obviously doesn't have any of the AI's attributes.

    Usually, since you are not overriding Unity's editor, but making your own class, you shouldn't have to derive from the InspectorEditor. You should have the same control that class offers directly from attributes in your code.
     
  32. TurboNuke

    TurboNuke

    Joined:
    Dec 20, 2014
    Posts:
    69
    Sorry for the delay getting back to you.
    The trouble with WindowsStore platform is that it doesn't appear to support all .net types:

    eg.
    Assets\Plugins\AdvancedInspector\Core\UDictionary.cs(17,194): error CS0246: The type or namespace name 'ISerializable' could not be found (are you missing a using directive or an assembly reference?)
    or
    Assets\Plugins\AdvancedInspector\Core\UDictionary.cs(17,194): error CS0246: The type or namespace name 'ISerializable' could not be found (are you missing a using directive or an assembly reference?)

    I did find some post referring to Windows Store missing features but I can't find it again at the moment. I'll post back here when I do manage to google it.

     
  33. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    That's rather odd. This would means Windows Store .NET is missing the System.Runtime.Serialization namespace.

    http://forum.unity3d.com/threads/sy...able-doesnt-exist-in-target-framework.216475/
    Sounds like it.

    You can try to remove the ISerializable and IDeserializationCallback from the UDictionary class, or if you don't use the UDictionary, you can simply erase that file. There is no dependency towards it.

    I guess the UDictionary or custom .NET serialization wouldn't work on with WP8.
     
  34. TurboNuke

    TurboNuke

    Joined:
    Dec 20, 2014
    Posts:
    69
    OK thanks that got me a little further.
    But sadly there's lots more.

    Assets\Plugins\AdvancedInspector\Attributes\Collection.cs(85,28): error CS1061: 'Type' does not contain a definition for 'IsEnum' and no extension method 'IsEnum' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)

    Assets\Plugins\AdvancedInspector\Core\ComponentMonoBehaviour.cs(109,43): error CS1061: 'string' does not contain a definition for 'Clone' and no extension method 'Clone' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

    Assets\Plugins\AdvancedInspector\Core\ComponentMonoBehaviour.cs(109,43): error CS1061: 'string' does not contain a definition for 'Clone' and no extension method 'Clone' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

    ..plus many more errors.

    I'll just have to give up on this. Thanks for the help, anyway.

     
  35. TurboNuke

    TurboNuke

    Joined:
    Dec 20, 2014
    Posts:
    69
    Is there any concept of 'seleted' in collections? I have long sortable lists and could really do with these being searchable. But I'm not sure how to go about doing that without being able to select an item or to scroll to a position programmatically.
    Any ideas?
     
  36. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Wow! String is lacking its clone method?! Ok, that's impressive.
    I guess I'll really need to find a Windows 8 or 10 computer and try it myself.
    From what you've shown me, I may end up with ton of #if around.

    I'm not sure what you mean. You want to be able to find an item in a collection? That the item would get highlighted? What should be searched, like a values, a name, or ToString?
     
  37. TurboNuke

    TurboNuke

    Joined:
    Dec 20, 2014
    Posts:
    69
    Simply put I want to be able to find an item in a long list, by typing in its name.

    Well for me if I write an editor to do this myself I'll probably have a text field to search for, and get the list to scroll it in view.

    Having a 'selected' or highlighted object would be great too, so that more info could be shown about that in a separate field. but it would also be good to see what you've found in the search.
    I guess a simpler solution would be to expand the item you've searched for and unexpand the rest.

    I'll probably have a callback to get the value to compare with, but at its simplest ToString() would definitely work.

    Multi select would also be useful if the search was a filter, like you get in the hierarchy or project windows.

    (I love your product, btw. but I'm also happy enough to go back to writing editors if this can't be implemented! :) )

     
  38. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Sorry for the slow answer. I'm still thinking about this, and I haven't came up with a proper way of implementing something like that.

    My apologize, but I think it will require more thinking.
     
  39. TurboNuke

    TurboNuke

    Joined:
    Dec 20, 2014
    Posts:
    69
    Of course, that's fine. Thanks even for considering it!

     
  40. FireMutant

    FireMutant

    Joined:
    Sep 2, 2013
    Posts:
    49
    Hi LightStriker,
    Any chance of an update soon for Unity 5.2.1? I know it's minor, but the warnings for Advanced Inspector obsolete enums every time I compile are very annoying. :eek:

    Thanks!
     
  41. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Which enum is obsolete?

    I'm really sorry for the delay of releasing a new version, by the way... The studio is currently finalizing funding for our first game, so we are all running around like headless chicken.
     
  42. FireMutant

    FireMutant

    Joined:
    Sep 2, 2013
    Posts:
    49
    Thanks for the quick response. The 3 warnings below. Congratulations and Best of luck on your game!

    Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs(65,88): warning CS0618: `UnityEngine.AnimationCullingType.BasedOnClipBounds' is obsolete: `Enum member AnimatorCullingMode.BasedOnClipBounds has been deprecated. Use AnimationCullingType.AlwaysAnimate or AnimationCullingType.BasedOnRenderers instead'

    Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs(65,157): warning CS0618: `UnityEngine.AnimationCullingType.BasedOnUserBounds' is obsolete: `Enum member AnimatorCullingMode.BasedOnUserBounds has been deprecated. Use AnimationCullingType.AlwaysAnimate or AnimationCullingType.BasedOnRenderers instead'

    Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs(67,100): warning CS0618: `UnityEngine.AnimationCullingType.BasedOnUserBounds' is obsolete: `Enum member AnimatorCullingMode.BasedOnUserBounds has been deprecated. Use AnimationCullingType.AlwaysAnimate or AnimationCullingType.BasedOnRenderers instead'
     
  43. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Hey, I'm trying to do something that I think AI can do, although I could be wrong.

    I have a MonoBehavior (Card) with a separate controller object (CardLogic) attached it. CardLogic is an abstract class, with a number of inheritors. It is not a MonoBehavior.

    I'd like to be able to select, from the editor, which CardLogic inheritor to use. (It wouldn't be the end of the world to have multiple classes inherit from Card and do away with CardLogic entirely, but it would make my workflow less flexible. I really don't want to resort to hacks like setting up an Enum with every CardLogic option.)

    I'm sorry if this is in the documentation: I skimmed it and poked around in the examples for a bit, but I don't know what this would be called if it is indeed possible.

    Thanks!
    -Lou
     
  44. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    You are looking for ComponentMonoBehaviour and the CreateDerived attribute.

    If you search for one or the other in your code solution you should find the example that display how it works.
     
  45. Mithion

    Mithion

    Joined:
    Dec 12, 2013
    Posts:
    14
    Hey again, I've been getting into some of the expanded features that this solution offers, and I have to say I don't regret picking this up at all. It's saved me a ton of time and hassle, and has let me focus on the implementation of other aspects of my game!

    That being said, I'm having some trouble writing a field editor for a two-dimensional array. I know it's always going to be booleans, and what I am going for is a 5x5 grid representing a visualization of what the array would look like from a top-down view.

    However, with the class below all I get from GetValue is a single bool - what would be the recommended way to go about getting this editor to work?

    Code (CSharp):
    1. public class FootprintEditor : FieldEditor
    2. {
    3.     public override Type[] EditedTypes
    4.     {
    5.         get
    6.         {
    7.             return new Type[] { typeof(bool[][]) };
    8.         }
    9.     }
    10.  
    11.     public override void Draw(InspectorField field, GUIStyle style)
    12.     {
    13.         EditorGUI.BeginChangeCheck();
    14.         Type type = this.GetType();
    15.         bool[][] value = (bool[][])GetValue(field);
    16.  
    17.         GUILayout.BeginVertical();
    18.         for (int i = 0; i < value.GetLength(0); ++i)
    19.         {
    20.             GUILayout.BeginHorizontal();
    21.  
    22.             for (int j = 0; j < value[i].Length; ++j)
    23.             {
    24.                 value[i][j] = GUILayout.Toggle(value[i][j], GUIContent.none);
    25.             }
    26.  
    27.             GUILayout.EndHorizontal();
    28.         }
    29.         GUILayout.EndVertical();
    30.  
    31.         if (EditorGUI.EndChangeCheck())
    32.         {
    33.             field.SetValue(value);
    34.         }
    35.     }
    36. }
     
  46. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Sadly - for now - Unity doesn't support serializing multi-dimension/jagged/nested array.
    And since it's simply impossible to serialize right now, there's not much support for it in Advanced Inspector. Not even sure how I could display that without making a mess of expandable groups within groups within groups.
    Currently, the InspectorField only returns the first dimension.

    However, the easiest work around is this;

    Code (CSharp):
    1.     public class MyBehaviour : MonoBehaviour
    2.     {
    3.         [Serializable]
    4.         public class BoolArray
    5.         {
    6.             public bool[] values;
    7.         }
    8.  
    9.         public BoolArray[] arrayInArray;
    10.     }
    I know it's not the cleanest thing ever, but it's the only thing Unity allows us when trying to do multi-dimension.

    So you could do a FieldEditor for a "BoolArray" and display a checkbox for each entry in it.
     
  47. Mithion

    Mithion

    Joined:
    Dec 12, 2013
    Posts:
    14
    No worries, I can make that work. Thanks for the quick response :)
     
  48. nonathaj

    nonathaj

    Joined:
    Sep 4, 2013
    Posts:
    8
    Hey Light, great asset. I use it on almost all my projects. However there are some projects that I can't use it on, but often include scripts from some of my other projects on (which use Advanced Inspector), and occasionally I share with colleagues who don't have it. The current fix is keeping multiple versions of my scripts around, or modifying them every time they move projects. I noticed back in update 1.43 you added a #define, but then removed it in update 1.44.

    Any chance we can see this return? It would really make my life easier when dealing with sharing scripts.
     
  49. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I removed it because it wasn't doing what I was hoping it would do...

    The issue, is that even with a #define in there, if you share a script that is using some attribute, your friend won't have those. And I'm pretty sure you don't want to do this;

    Code (CSharp):
    1. #if ADVANCED_INSPECTOR
    2.     [Inspect]
    3. #endif
    4.     public bool myValue;
    You could always share the attributes and the interfaces, since on their own they don't do much. You could even package them in a DLL for your friends.
     
  50. nonathaj

    nonathaj

    Joined:
    Sep 4, 2013
    Posts:
    8
    That is actually exactly what I want to do. Many of those that I share scripts with are designers, and will never touch the code anyhow. They use the scripts for convenience, and a few #if checks for the coders that I share with would be a small price for not having to edit the files again.