Search Unity

Advanced Inspector - Never Write An Editor Again

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

  1. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    "I don't like having to add stuff to my existing script to use this plugin."

    Alright... That's a fair comment I received. At first, we had the AdvancedInspector attribute as a switch between the basic Unity behaviour and our own for a good reason; to not break existing custom editor.

    However, as AI evolved, it now has an internal dictionary of all the available InspectorEditor and all the Custom Editor.

    So;



    In the next version, this switch is on by default. In other words, all classes that do not have an explicit custom editor associated with them get to be drawn by the AI automatically. No more need to tag everything with [AdvancedInspector].

    Since we have to create a set of preference, what kind of global switch would you like to be added?

    EDIT: One last thing;



    Nesting array and list;

    Code (CSharp):
    1.     public List<List<int>> nested = new List<List<int>>();
    2.  
    3.     public int[][][] array;
     
    Last edited: Dec 31, 2014
    cybervaldez likes this.
  2. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Version 1.5 is now available on the store. Try out the save and watch feature! :)
     
    cybervaldez likes this.
  3. cybervaldez

    cybervaldez

    Joined:
    Aug 16, 2014
    Posts:
    87
    Thanks for this!
     
  4. Guillaume-Portes

    Guillaume-Portes

    Joined:
    Oct 10, 2012
    Posts:
    13
    Hello!

    We've just noticed that OnValidate() is not getting called on changing values in the inspector when a class is AdvancedInspected (we are on 1.44). It seems to be called on serializing the asset in though.
    We can of course implement IDataChanged, but I was wondering whether it was just a bug, or a design choice.

    Thanks,

    G.
     
  5. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Thanks for spotting this. I've just submitted 1.51 for review on the Asset Store with a fix for OnValidate.

    The manual and tutorial have been updated to 1.51. Here's the changelist;

    1.51:
    - Added support for nested collection; T[][], List<List<T>>, Dictionary<K, V>, etc.
    - Added support for char, decimal, double, byte, short, long, uint, ushort, ulong, sbyte.
    - Note that the above types are not serialized by Unity, so a third party serialization is required.
    - IDataChanged and OnValidate are now properly called only when a value change, not only when the GUI is modified.
    - Fixed an issue in the Animation component.
    - Fixed an issue where some dictionary value type wouldn't be recongnized.
    - Fixed an issue where sometimes a value could not be removed from a dictionary.
    - Fixed an issue where some types might not get expandable.
    - Added a preference window where some settings can be modified.
    - Added a global "Inspect Default Items" preference in Unity Preferences panel. This allow inspection of class that do not have [AdvancedInspector] attributes.

    The last item is the trickiest. In 1.51, every class that do not have a Custom Editor is handled automatically by Advanced Inspector, unless the switch in the Preferences is turned off. This is great because it means no need to modify your class to take advantage of AI. However, it is possible that some class may be handled by AI while it shouldn't. Let me know if you find any cases of this.

    From the 1.51 tutorial;
     
    Last edited: Jan 18, 2015
  6. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    IMPORTANT

    A critical bug have been found in the Animation component and the Mesh Renderer component with the introduction of the Watch/Save feature of 1.5. This bug prevent modification of the material and animation lists in those components. A version (1.51a) have been submitted for review to the asset store.

    If you are encountering this issue, contact me at admin@lightstrikersoftware.com and I'll gladly give you the fixed version.

    My apologize for the inconvenience.
     
  7. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    1.51b is now available on the Asset Store.
     
    cybervaldez likes this.
  8. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Advanced Inspector is currently on sale for 24h at 60% off!

    Also, version 1.51f was submitted to the Asset Store for review. This build includes fixes for texture in linear mode and removing some unwanted debug log.
     
  9. fivearchers

    fivearchers

    Joined:
    Apr 17, 2009
    Posts:
    716
    Keep getting errors thrown by Advanced Inspector due to other plugins eg:
    Advanced Inspector found multiple Custom Editor trying to edit the same type; Shader
    UnityEngine.Debug:LogError(Object)
    AdvancedInspector.InspectorEditor:CollectInspectorEditors()
    AdvancedInspector.InspectorEditor:OnEnable()

    Another Example:

    Advanced Inspector found multiple Custom Editor trying to edit the same type; MegaModifier
    UnityEngine.Debug:LogError(Object)
    AdvancedInspector.InspectorEditor:CollectInspectorEditors()
    AdvancedInspector.InspectorEditor:OnEnable()



    (This is for Shader Lab AFAIK, and similar errors with some of the Mega Plugins)

    Any suggestions?
     
  10. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    This is the "unwanted debug log" that was removed in version 1.51f. Hopefully the store should have it up soon, otherwise you can contact me at admin@lightstrikersoftware.com and I'll give you the version where that log was removed. You can ignore it, it has no impact on anything.
     
  11. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi. I need to know one thing before buying. Please answer asap while the deal is on :)

    I have a shader pack asset. I would like to make a custom inspector for it. Is it possible to make a custom inpector with your asset and then share the result, without including your asset in mine ?

    Cheers
     
  12. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Sorry, right now AI doesn't support modifying shaders inspector, since attributes are rather nonexistent in them.
    Also, the purpose of this package is to not have to write custom editor. Ever. ;)
     
  13. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Well, forget about shaders.. it could be usefull for other things. But I want to know if the resulting custom editor is separated from your asset in a way that I can include that in any other package and share it or sell it, or the resulting custom editor will need Advanced Inspector in the project.
     
  14. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    It does not create a custom editor. How the inspector handles data have been rewritten from scratch to be more flexible and not serialization bound. So for your question, no it does not produce something you can distribute, since we are talking of tens of thousand lines of code.

    On a side note, the store released version 1.51f. Nice timing!
     
    Last edited: Jan 28, 2015
  15. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Thanks for the fast anwser. And I bought it anyway :)
     
  16. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Let me know if you need anything. :)
     
  17. Greg-S

    Greg-S

    Joined:
    Mar 3, 2012
    Posts:
    7
    I just picked up this in the sale. Drag and drop resorting of Arrays in the inspector was enough to be amazing.

    So far quite impressed.

    One question I had though, [Header("Name of Section")] no longer works. Which is not a huge deal. I saw I can recreate a better version of it through [Group]. However, the somewhat annoying part about group is having to put it on every single variable vs Header you could do for a group of variables. Is there any way you could do like [StartGroup("name")] int blah;int blah;etc[EndGroup] to have a section without making your code look like a mess of group names (see screenshot)?

    Or a replacement to Header?

    Thanks!
     

    Attached Files:

  18. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Sorry for the slow reply, I've got quite some feedback to cover by email.

    In the version I've currently working on following some people comments (1.52), I've added support for ALL Unity default attributes; Space, Header, Tooltip, TextArea, Multiline, Range. Contact me at admin@lightstrikersoftware.com if you want it now.

    As for the Start/End group, it's a great idea, I need to investigate it more... I need to make sure that Fields, Properties and Methods retrieved by reflection are taken in proper order.
     
    Last edited: Jan 29, 2015
  19. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    Just bought this and looks cool overall, but I ran into two big issues.

    1) After installing, I was no longer able to modify values of fields such as transforms with just the mouse. I had to enter each value manually.

    2) I went to the preferences and turned off use Advanced Inspector for default components, but it did nothing. Advanced Inspector was still trying to draw my transforms/defaults. I quit and restarted many times to no avail.

    I ended up having to delete Advanced Inspector from my project.
     
  20. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Drag of field from their label now perform a copy-paste. We went that way because all values can be copy-pasted, but only numbers can be "scrolled". Instead, you should do Shift+Drag to "scroll" values. Maybe it would be useful to add an option to invert that behaviour?

    The "Inspect Default Items" option is - like the description says - only for class that has no Custom Editor associated. To override Unity owns editor, we had to make our own and they are contained in Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ . You can remove, edit or add new one there. We still haven't found an easy way to turn them on or off from a single switch.

    If that switch is off, you need to explicitly flag your class to be drawn by Advanced Inspector by adding [AdvancedInspector] to them. As soon as the AI finds a Custom Editor associated to a class, it leaves that editor the task of handling it.
     
  21. Enoch

    Enoch

    Joined:
    Mar 19, 2013
    Posts:
    198
    Awesome asset, bought it during the sale. I have some requests though :).

    First is it possible to allow selecting a derived type for a base class that isn't itself derived from
    ComponentMonoBehaviour? It would be nice to have these be regular old class objects. I often test some of my systems (via VS test suite) outside of Unity and I can't really instantiate MonoBehaviors outside of unity.

    Also I would love some more options for collections. The issue that comes up often for me is a way to set the label on the collection header. Having them be [0],[1],[2] is great but I would rather be able to set the label based on data in the object they represent ie [sword],[axe],[spear], something like [Collection(Display = CollectionDisplay.List,"Name")] where "Name" is a field on the collection list item. Unity's default list takes the first listed field as the label for the item, even this would,for me, be better than the numeric.

    Thanks, keep up the good work.
     
  22. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Happy to hear you're enjoying it.

    CreatedDerived is not bound to ComponentMonoBehaviour. However, Unity is unable to serialize polymorphic instance of a base class that does not derive from UnityEngine.Object. So if you have your own serialization, you can use CreateDerived to create pretty much any kind of instance. It even works with interface if you want, but again, it's a matter of serialization.

    Yes, it's possible to have the "index" of a collection to display names instead of integer. If you check the last field of AIExample7_Collection, you can see a collection bound to the names of an enum.

    Code (CSharp):
    1.     // A collection size and index can also be bound to an enum type.
    2.     [Inspect, Collection(typeof(MyCollectionEnum))]
    3.     public List<Vector3> enumBoundList;
    4. }
    5.  
    6. // When binding an enum with a collection, the values should be in a zero-based 1 increment order, similar to the index of the collection.
    7. public enum MyCollectionEnum
    8. {
    9.     ZeroValue = 0,
    10.     FirstValue = 1,
    11.     SecondValue = 2,
    12.     ThirdValue = 3,
    13.     ForthValue = 4
    14. }
    The interest of this is that in your code, you can access the indexes using the enum; "enumBoundList[MyCollectionEnum.ThirdValue]".
     
  23. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I have to say, this week have been productive for feedbacks and ideas.

    Here's what coming to 1.52;



    • Ability to turn on/off specific Advanced Inspector editor. You don't want AI to handle the CharacterController? Click it off.
    • Styles; some people don't like the rounded boxes; so you'll have the choice of a flat Unity style, or even no boxing at all similar to how Unity usually renders the Inspector.
    • Control; One feature of Advanced Inspector is that you can copy-paste values by dragging the label. However, some people might prefer the normal drag to "scroll" numbers like Unity does. This way, you can set it the way you want; drag, shift+drag, alt+drag, control+drag.
    • Support for all Unity basic attribute; Range, Multiline, TextArea, Header and Space. Less modifying your existing script.
    • One feature of Unity is the ability of dragging multiple files on a list/array. In Advanced Inspector, we go one step further, you can drag a folder, and AI finds the valid files inside it to be added to the list.
    • A new attribute we used a few time internally; NoPicker. It simply disable the picking tools on an object field. It's useful when that object is not supposed to be set in the inspector.
     
    cybervaldez likes this.
  24. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Congrats for climbing over the top man :)

    Currently it's the 1st in Editor Extensions category and 4rd in home page of the AssetStore

    And did I mention that I absolutely love the all 5-stars rated, all 5-stars comments extensions ?
     
  25. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Thanks a lot.

    Actually, I think there's 2 4-stars rating in AI reviews. I don't mind them, they pointed me towards very valid issues I had to fix.

    I think the word here is, if you haven't registered your asset for the possibility of being on sale, you should.
     
  26. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Little tip... Let's say you have a collection like this;

    Wouldn't be nice to know what those items are?

    It's very easy! You add this;

    Code (CSharp):
    1.         public override string ToString()
    2.         {
    3.             return name;
    4.         }
    And then it shows up like this;


    You can override the ToString method to return whatever you like, and the AI will display it.
     
    jmjd likes this.
  27. jcman

    jcman

    Joined:
    Jan 12, 2014
    Posts:
    15
    I just bought this extension - very impressive - it could save me a lot of time!

    However, I'm having an issue with the way it modifies the Animator inspector: "Update Mode" changes from a selector with 3 possible values, to a checkbox called "Animate Physics". Basically, you can't select the "Unscaled Time" update mode any more which means you can't animate UI elements while pausing physics etc.

    Animator Inspector Original.png Animator Inspector Advanced.png

    Any ideas what's going on here?

    Cheers,

    Chris.
     
  28. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    It's very simple... Unity changed the animator and I didn't notice it.

    I'll update AnimatorEditor for the new update mode.

    You can easily fix it by replacing the line #25 in Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs with;
    Code (CSharp):
    1. fields.Add(new InspectorField(type, Instances, type.GetProperty("updateMode"),
    2. new DescriptorAttribute("Update Mode", "Specifies the update mode of the Animator.", "http://docs.unity3d.com/ScriptReference/Animator-updateMode.html")));
    I'll add a way to track when Unity adds "Obsolete" on something.

    In version 1.52, you will also be able to turn off from the preference panel which classes you don't want AI to handle.

    Sorry for that.
     
    Last edited: Feb 3, 2015
  29. tonic

    tonic

    Joined:
    Oct 31, 2012
    Posts:
    439
    When trying to use AI, I also noticed right away not having the ability to "scroll" the values of the Transform. And even the Shift+Drag doesn't seem to work on fields which have multiple values (e.g. ones in the Transform). I seem to use those frequently, so could you add back the possibility of scrolling transform field values (XYZ for each of position, rotation and scale)?
     
  30. jcman

    jcman

    Joined:
    Jan 12, 2014
    Posts:
    15
    Ah great, a nice simple fix. Actually I didn't realize all the overrides were right there in the plugin code! Thanks very much for the help.

    Chris.
     
  31. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I'm currently working on that. It will come with 1.52 at the same time as the option to change how you access those control from the preference screen (Drag, Drag+Shift, Drag+Alt, Drag+Control). I should be able to submit it to the Asset Store this week.

    Yup! They are all exposed. You can even add button or function to existing Unity inspectors. One example is the camera, in advanced or debug mode, there's a button to take screenshots. ;)

     
    Last edited: Feb 3, 2015
  32. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Version 1.52 will submitted to the Asset Store as soon as I finish updating the documentation.

    The changelist;
    • IMPORTANT: To avoid conflict with UnityEngine.SpaceAttribute, AdvancedInspector.SpaceAttribute have been renamed to SpacingAttribute.
    • Added a new attribute; NoPicker. It removed the picking tools from an object field. Useful when the object should not be modified from the inspector.
    • Added a new attribute; Title. It replaces Unity Header attribute but can be placed on properties, methods and can be set at runtime.
    • Added support from drag-dropping multiple files, or even a folder of files in a collection.
    • Added support for Unity Range, Multiline, TextArea, Header and Space attribute. Note that they still don't work on properties.
    • Added "style" choice in the preference panel, you can change how the layout looks like.
    • "Value Scrolling" and "Copy Paste by Drag" control can now be set in the preference panel.
    • The preference panel can now disable specific Advanced Inspector inspector override.
    • Value Scrolling now works on composite fields like Vectors, Rect, Bounds, etc.
    • Fixed an issue where Collection(0) would sometime override the current collection with a 0-sized one.
    • Fixed CharacterControllerEditor and ClothRendererEditor which gave error in Unity 5 beta 20. Unity 5 support is still sketchy.
    • Fixed an issue with nested struct. It now works fine, but you should know it's a bad idea performance-wise.
    • Fixed an issue with RigidBodyConstraint display.
    • Fixed an issue where the "Inspect Default Item" would sometime catch Unity's type while it shouldn't like GUISkin.
    • Fixed a layouting issue where a help is applied to an expandable item.
    • Fixed an issue where items could show up as being exandable even if they were not. Most in case of UnityEngine.Object.
    • Fixed an issue where reordering a list would fail to flag the object dirty.
    • Updated the Animator editor to for the new Update Mode property.
     
  33. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I am currently using AI but I can't enter float point number for my box collider size property.
    It only accepts integer values. Any ideas?

    Edit ---

    I was able to do it after restarting Unity. Not sure why it didn't work before... :p
     
    Last edited: Feb 4, 2015
  34. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Very odd. Let me know if it does that again and if you can find any repro steps.
     
  35. Zoey_O

    Zoey_O

    Joined:
    Mar 15, 2013
    Posts:
    28
    I was having an issue in a new Unity 5 beta 20 project. This is with 1.51f I believe (Jan 28?). If I create a new project, and create a new MonoBehaviour, then without even adding the inspector attribute, its automatically using the Advanced Inspector rendering. I'm not sure how long this has been happening since I usually WANT the Advanced Inspector rendering, but its butchering the UnityEvent inspector and turning it into an expandable object (which might be fixed in 1.52?). Anyway, let me know if you need anything from me to look into this. Thanks!
     
  36. Zoey_O

    Zoey_O

    Joined:
    Mar 15, 2013
    Posts:
    28
    Seems to happen in Unity 4.6 as well. AdvancedInspector 1.51f, Make a MonoBehaviour script with a UnityEvent. Before even adding it to the game object you can see that the transform is using the AdvancedInspector editor, and then adding the MonoBehaviour also has AdvancedInspector editing and an expandable UnityEvent object rather than the default UnityEvent editor that you see on the new UI Controls like Button.
     
  37. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Since 1.51, there's an option in Preference > Adv. Inspector named "Inspect Default Items". Lot of people didn't want to add [AdvancedInspector] and [Inspect] in their classes, so that option removes that "requirement". You can turn it off to return to the previous behaviour.

    However, I never really tried to render UnityEvent. I'll let you know as soon as I know what it involves. Can you give me an example of your class?
     
  38. Zoey_O

    Zoey_O

    Joined:
    Mar 15, 2013
    Posts:
    28
    That fixes it! Man I guess I didn't read the notes well enough =) If you just create a MonoBehaviour with a UnityEvent field such as:

    public UnityEngine.Events.UnityEvent TestEvent = new UnityEngine.Events.UnityEvent();

    You can see below what the Advanced Inspector version is doing vs the regular Unity inspector with and without a delegate assigned to the event.

    Without.png DefaultWithDelegate.PNG With.png AdvancedInspectorWithDelegate.PNG
     
  39. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Damn... Took me a while! For some reason, using PropertyField with a UnityEvent is failing big time. However, I never noticed UnityEventDrawer is actually public in UnityEditorInternal and works just fine on its own. :)

    Code (CSharp):
    1. using System;
    2.  
    3. using UnityEngine;
    4. using UnityEditor;
    5. using UnityEditorInternal;
    6. using UnityEngine.Events;
    7.  
    8. namespace AdvancedInspector
    9. {
    10.     public class UnityEventEditor : FieldEditor
    11.     {
    12.         public override bool EditDerived
    13.         {
    14.             get { return true; }
    15.         }
    16.  
    17.         public override bool Expandable
    18.         {
    19.             get { return false; }
    20.         }
    21.  
    22.         public override Type[] EditedTypes
    23.         {
    24.             get { return new Type[] { typeof(UnityEventBase) }; }
    25.         }
    26.  
    27.         private static UnityEventDrawer drawer = new UnityEventDrawer();
    28.  
    29.         public override void Draw(InspectorField field, GUIStyle style)
    30.         {
    31.             GUILayout.BeginHorizontal();
    32.             GUILayout.Space(4);
    33.  
    34.             SerializedObject so = new SerializedObject(field.SerializedInstances);
    35.  
    36.             so.Update();
    37.  
    38.             SerializedProperty sp = so.FindProperty(field.Info.Name);
    39.             drawer.OnGUI(GUILayoutUtility.GetRect(10, drawer.GetPropertyHeight(sp, new GUIContent(field.Name))), sp, new GUIContent(field.Name));
    40.  
    41.             so.ApplyModifiedProperties();
    42.  
    43.             GUILayout.EndHorizontal();
    44.         }
    45.     }
    46. }
    I would love to dump the label at the top... but it's going to be for another time.
     
  40. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Version 1.52 have been submitted to the Asset Store. It also includes the above support for UnityEvent.

    The documentation have been updated.

    What is important;
    • Space attribute have been renamed to Spacing to avoid colliding with UnityEngine.Space.
    • Unity attributes Header, Space, Multiline, TextArea and Range are now support, but handled by AI. For now, Multiline and TextArea pretty much gives the same result.
    • NoPicker is a new attribute that removes the object picking fields. Useful when an object is set by an editor and shouldn't be changed by the inspector.
    • Title is a new attribute, similar to Unity's header, but you can place it on properties and methods. You can also change the Font style.
     
  41. Enoch

    Enoch

    Joined:
    Mar 19, 2013
    Posts:
    198
    Perfect, this is exactly what I needed.

    Now I have another question about collections, I use very large lists to configure my app and in this case the editor starts to slow down, you have a scroll arrow that appears if the list gets rather big. This next page prev page feature is something I would like to configure. While I would love a full pagination control (jump to page 1-10, etc), my immediate needs are just to be able to configure how large the the page size is. I would like setup the collection so that maybe only 10 records at a time render in the editor. Is this possible right now?

    The next question I have is about distribution. Have you thought at all about how this tool could be used to create editors that could be distributed in other assets? Perhaps you could create a stripped down free version with a bunch of the features removed or disabled? Perhaps a DLL version that only supports Editors derived from External, Inspector or Field editor? I am not sure there is a way to distribute a derived editor without allowing the user to use this product tool, but have you given it any thought?

    thanks for the great asset...
     
  42. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    That's a great idea. I'll add that in the next version. Will most likely be a property of the Collection attribute.

    Now that is something I've been asked a few times, but I never really thought deeply about it. However, I think I've come up with a good solution, but that would involve dealing with a case-by-case solution.

    What I would do;
    - Remove all the custom Unity editor override.
    - Package all the attributes, interfaces, event and FieldEditor in a DLL, so the solution would only have AdvancedInspector.dll and AdvancedInspectorEditor.dll.
    - Hard code the list of classes that the AI is allowed to draw, so everything else is ignored. Probably by name.

    I think that way it means a published tool could have all the feature of AI without having to deal with the license issues.

    The downside would be that every publisher who want to distribute his asset with AI would need a custom DLL for their assets.
     
  43. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I was about to come here to say; "Hey, I've written a FieldEditor that allows to draw fiValue from Full Inspector."

    Instead, I'm not going to say that, since I've erased that code. I've also erased the above UnityEventEditor code from the next version.

    In 1.53, I've simply added support for PropertyDrawer. This does not include PropertyAttribute, only drawers that handles a specific type and/or its derived one. However, it means almost by magic that UnityEvent and FullInspector's fiValue are now drawn without much work. It also means that if you had previously existing PropertyDrawer, they can now work properly in Advanced Inspector.



    Why it took so much time to actually support PropertyDrawer that handles drawing specific type? Because if you check Unity code, until UnityEvent came in 4.6, they actually never used it, so I never had a direct example of a proper implementation and easy way to test it.

    Contact me if you want a beta version of this feature.
     
    cybervaldez likes this.
  44. runerask

    runerask

    Joined:
    Mar 30, 2013
    Posts:
    9
    Hey Lightstriker!

    Great plugin, and awesome work with all the updates! - However i have run into what seems to be a serialization issue with the ComponentMonoBehavior!

    The ComponentMonoBehavior, and it's integration with the AI is prolly my favorite feature! And i use it extensively in my project, but i'm having a issue where references are lost when i close unity and re-open it.


    So some of my MonoBehaviors have quite a deep hierarchy of [CreateDerived] Lists and Properties imagine something like:

    SomeController:
    --------[CreateDerived]List<SomeConditionComponent>
    -------------[CreateDerived]List<SomeActionComponent>
    ---------------------[CreateDerived]List<SomeImplementationComponent>

    The whole thing works like a charm in the Editor, i can play, pause, stop, replay, and no references are lost, but if i restart unity, some of the [CreateDerived] fields wont be real instances, even if they show up in the Inspector. I get no direct errors, but if i check the length of one of the "problem" lists during runtime, i can see that the length is 0. If i remove the items from the list, and re add them from the Inspector, it works again - until next restart.

    I was looking thru the code of ComponentMonoBehavior, but saw no direct evidence of why this would happen, so i figured it must reside in the way that CreateDerived works and handles storing/serialization of those instances.

    It could also be that i'm doing the setup wrong, if so could you tell me the exact "proper" way of declaring fields that should be handled by AI? Are there any rules as to, for list's or objects for example, when to initialize it?

    Hope i make sense!
    Cheers,
    Rune
     
  45. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Which version are you running? In some version, we had issue where some might get destroyed for no reason. Be sure to have 1.51f or above. 1.52 should be available on the store this week.

    Usually, the example coming with AI - AIExample27_CreateDerived - shows how to use it. As long as your fields are serialized properly - public, or with [SerializedField] - it should work fine. Prior to 1.51f, private fields in deep nested classes had issues.

    Otherwise, you could send me an example so I could track down if there is any issue.
     
  46. runerask

    runerask

    Joined:
    Mar 30, 2013
    Posts:
    9
    Alright! Well it looks like im using 1.51 straight, so i'm gonna update and see how that goes! ^^ Thanks a lot for the quick reply.

    Cheers
     
  47. KimNulbo

    KimNulbo

    Joined:
    Jun 25, 2014
    Posts:
    8
    I Want Change Values GT_PlayerData.ICount In Inspector
    Problem is lcount will return to the Run and the original value
    What am i wrong?
    [AdvancedInspector]
    public class GT_GameSystem : MonoBehaviour
    {
    [Inspect]
    public GT_PlayerData playerDataArrow = new GT_PlayerData();
    [Inspect]
    public GT_PlayerData playerDataGold = new GT_PlayerData();

    public class GT_PlayerData
    {
    [Inspect]
    public long lCount = 50;
    [Inspect]
    public float fAcumRate = 1f;
    }
    }
     
  48. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    You're missing [Serializable] on your GT_PlayerData class.

    Also, Unity is unable to save "long".
     
  49. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    I've got to say, this is hands-down the best editor/inspector asset I've used. I used to either settle for sub-par inspectors or spend hours getting something decent done, but now I can create a complicated inspector -- that looks great -- in an hour or so, tops. Great work, @LightStriker!

    I'm curious, though, if there's an easy way to override how UDictionaries display their entries. Currently if you add a new entry it goes to the top of the displayed list. Ideally I'd like for new entries to be displayed below the already-existing entries -- in other words, I'd like to have the list read oldest to newest, instead of newest to oldest, as it is right now.

    Would this be possible?
     
  50. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Happy to hear that you like it. :)

    Not really, because the inspector displays it the way a .NET Dictionary order its own values. If you delete an item and add a new one, the "erased" slot will be re-used... In the end, the order of item in a dictionary is totally out of my hands. More info;

    http://stackoverflow.com/questions/154307/why-are-entries-in-addition-order-in-a-net-dictionary
    http://stackoverflow.com/questions/4007782/the-order-of-elements-in-dictionary