Search Unity

Advanced Inspector - Never Write An Editor Again

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

  1. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    That's unfortunate.

    As an aside, I've found that you can sort-of get this to work if you tag the item as a [Collection]. On the first script reload it will reorder the entries into the correct order, but after a while (remove an entry, etc.) it will lose its order again. Is that just a fluke, or could something like this actually work with a bit of elbow grease?

    Thanks for getting back to me, though! You saved me a ton of time. :)
     
  2. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    That's most likely a fluke, because the Collection attribute has no effect on dictionary.

    What you could do, is simply write a deterministic "dictionary"... like a list of keys and a list of values. It shouldn't be too hard to refactor UDictionary towards that since it serializes the data as two lists anyway. As long as your class implement the IDictionary interface, the AI will see it as a dictionary.

    However, you would lose some of the search speed a dictionary offer as in background, there wouldn't be a real dictionary handling hashes.

    Little funny thing, the Advanced Inspector don't really know or care what type of collection you use, it just sees two interfaces; IList and IDictionary. For work, I've wrote an ObservableList that raises event when an items changes, and no work was needed in the AI. The exception to this are arrays, which is different.
     
  3. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    It was more of an OCD thing from me, I'm not really looking to rework the wheel here just to have things listed to my preference. ;)

    Thanks for the insight, though, I learned something new today because of it. :)
     
  4. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Well, I've got another possibly impossible question about UDictionaries again, if you don't mind. :)

    Is there any way to change the color of either the background or header? I've got some nested classes that inherit from UDictionary, and it gets kind of hard to manage when I have a nested list of things that all look the same. Being able to differentiate them in any way would be a huge plus.

    Any ideas? (And thanks!)
     
  5. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    [Background] allows you to change the "box" background color. (AIExample14_Background)
    [Descriptor] allows you to change the "field" - the right column - color. (AIExample5_Descriptor)

    Is it what you need?
     
  6. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    I was pretty sure that those were what I needed, but they don't appear to work with UDictionary. Am I doing something incorrect, or are these incompatible.
     
  7. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I just made this colorful horror with it;



    Code (CSharp):
    1.     [Serializable]
    2.     public class StringGameObjectDictionary : UDictionary<string, GameObject> { }
    3.  
    4.     [Inspect, Background(0, 1, 1), Descriptor(1, 1, 0)]
    5.     public StringGameObjectDictionary myDictionary = new StringGameObjectDictionary();
     
  8. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Thankfully, I think I narrowed it down! I couldn't figure out why it wasn't working, but then I realized that I was using the Dark editor theme. Here's a comparison picture of the Light and Dark theme, running the same code you posted:


    It looks like Advanced Inspector just isn't applying when using the Dark editor theme. Does this show up on your end too, or do I have some kind of quirky editor bug?
     
  9. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I see green on both... Just that Unity is doing it on a multiplication way, so the dark theme shows up as dark green.

    What I could do, is to use the light box style when background attribute is used for both light and dark style, so the box would show as the same color.
     
  10. seffles

    seffles

    Joined:
    Oct 2, 2013
    Posts:
    32
    I hesitated to pick up Advanced Inspector for a few days as I'm struggling a bit financially after the holidays, but finally gave in and bought it yesterday. I'm extremely impressed and I think it's well worth eating noodles for the rest of the month. Thank you for your hard work, LightStriker, it's awesome! :)

    I have a request though. While using [Inspect("FunctionName")] is very useful, it would be even more amazingly useful if it worked with get properties too.

    So, as well as this:

    [Inspect("Function")]
    public int Something;
    private bool Function() { return true; }

    I could do this:

    [Inspect("Property")]
    public int Something;
    private bool Property { get { return true; } }

    Is this something you'd consider adding for future release?
     
  11. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Done. Will be in 1.53. Contact me at admin@lightstrikersoftware.com if you want a beta version of that.
     
    seffles likes this.
  12. seffles

    seffles

    Joined:
    Oct 2, 2013
    Posts:
    32
    Wow, that was fast! Thank you! :)
     
  13. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Using the Light box style would probably be best, as I can't find a color that's significantly different than the normal dark color. Maybe make it an attribute override, if there's some reason to keep the current functionality?

    Thanks for looking into it! It was kind of driving me nuts.
     
  14. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Im kind of unclear on what this tool does... the claim is to never write an editor again... does this mean you can build custom inspectors in some kind of wysiwyg way, and it generates code for you, or at least a template for the code?
     
  15. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    No, it does not generate code, or WYSIWYG or template.

    It takes every needs you usually have from a custom inspector and expose it to your game code in the form of attributes and interfaces. It's totally uncoupled from serialization, and it let you inspect properties and methods. While being at it, we dumped SerializedObject and SerializedProperty, and rewrote them to support stuff like copy-pasting values and watching-saving values at runtime. You can see everything that is exposed in the manual; http://lightstrikersoftware.com/docs/AdvancedInspector_Manual.pdf

    From the moment I wrote my first custom editor, I hated them a lot. It was always some repetitive boiler-plate code. I'm now working on my 5th Unity game, and we have yet find a case where we couldn't do the same without a custom editor.
     
  16. runerask

    runerask

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


    I have a question about derived ComponentMonoBehaviors again (Since i love them so much! hehe)!

    Could it be possible to assign the instance of a [CreateDerived] Property to a field of another CreateDerived instance? (injecting a refference rather than creating a instance).

    Imagine a setup where:

    MonoBehavior A has a [CreateDerived] list of type ComponentMonoBehavior called B, which has a [CreateDerived] list of type ComponentMonoBehavior called C. which has a field of type B (not derived).

    I now want to assign a [CreateDerived] instance of B to the field in C. Is this possible?


    I hope i make sense!
    Rune
     
  17. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I'm not sure of the cases where this could be useful. I guess it's a matter of semantic since I never needed a sub-component to communicate with another component. My sub-components always had very specific task that required a single owner.

    Anyway, it shouldn't be an issue if you really want to try it. Simply have your C class have a field of the right type without [CreateDerived]. In background, ComponentMonoBehaviour are still MonoBehaviour, so you can reference them like any others.
     
  18. runerask

    runerask

    Joined:
    Mar 30, 2013
    Posts:
    9
    My specific case is that i am creating data, that is dependent on other data.

    The problem isn't that the field wont accept instances of the right type, the problem is that there is no way to select a derived Instance.

    Example:

    Code (CSharp):
    1. class myContainer : MonoBehavior
    2. {
    3.          [Inspect, CreateDerived]
    4.          public List<DataThing> DataList;
    5. }
    6. class DataThing : ComponentMonoBehavior
    7. {
    8.         [Inspect, CreateDerived]
    9.         public List<Dependency> DependencyList;
    10. }
    11. class Dependency : ComponentMonoBehavior
    12. {
    13.      [Inspect]
    14.      public DataThing ThingToGetDataFrom;
    15. }

    My Inspector might look like this:

    myContainer
    -----> DataList
    ----------> DataObject1
    --------------->Dependency1
    -------------------->ThingToGetDataFrom
    ---------->DataObject2
    --------------->Dependency2
    --------------------->ThingToGetDataFrom


    The problem is that, there is no way to drag'n'drop/pick/select DataObject1 as the refference for Dependency2's field.
    If i have a prefab or a gameobject, it works fine, but i cant assign the [CreateDerivedInstance] (and you are right, i prolly could, it's just that there is no obvious way to select it).

    I hope that makes more sense!
     
    Last edited: Feb 16, 2015
  19. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Not really... It should just show an object field, so you can drag and drop the GameObject in it and it should automatically select the proper component. Or you can use the object picker.

    I just tested it and it works fine. In the case a GameObject have multiple component of the same type, AI actually shows a drop down list;



    Yeah, one of those hidden feature of AI that nobody knows about. ;)
     
  20. runerask

    runerask

    Joined:
    Mar 30, 2013
    Posts:
    9
    ok.... im just stupid XD.

    It never occurred to me that assigning the GameObject itself as would work (since it had multiple instances) but yeah, it does work! haha. Intuitively i just wanted to somehow drag a list entry into the field, even tried using the picker to click the list elements - maybe a future feature? :D

    Thanks a lot again, and i will scurry away while i feel a bit ashamed :p learn something new about your great asset everyday!
     
  21. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Sometimes I get this error :

    NullReferenceException: Object reference not set to an instance of an object
    AdvancedInspector.InspectorField.ExpansionState () (at c:/Users/LightStriker/Desktop/AdvancedInspector/AdvancedInspector Lib/AdvancedInspector/AdvancedInspector/InspectorField.cs:1797)
    AdvancedInspector.InspectorField.ParseFieldAttributes () (at c:/Users/LightStriker/Desktop/AdvancedInspector/AdvancedInspector Lib/AdvancedInspector/AdvancedInspector/InspectorField.cs:1689)
    AdvancedInspector.InspectorField..ctor (AdvancedInspector.InspectorField parent, Int32 index, System.Type type, System.Object[] instances, UnityEditor.SerializedProperty serializedProperty, System.Attribute[] attributes) (at c:/Users/LightStriker/Desktop/AdvancedInspector/AdvancedInspector Lib/AdvancedInspector/AdvancedInspector/InspectorField.cs:1314)
    AdvancedInspector.InspectorField..ctor (System.Type type, System.Object[] instances, UnityEditor.SerializedProperty serializedProperty, System.Attribute[] attributes) (at c:/Users/LightStriker/Desktop/AdvancedInspector/AdvancedInspector Lib/AdvancedInspector/AdvancedInspector/InspectorField.cs:1282)
    AdvancedInspector.AnimationEditor.RefreshFields () (at Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs:38)
    AdvancedInspector.InspectorEditor.set_Instances (System.Object[] value) (at c:/Users/LightStriker/Desktop/AdvancedInspector/AdvancedInspector Lib/AdvancedInspector/AdvancedInspector/InspectorEditor.cs:99)
    AdvancedInspector.InspectorEditor.OnEnable () (at c:/Users/LightStriker/Desktop/AdvancedInspector/AdvancedInspector Lib/AdvancedInspector/AdvancedInspector/InspectorEditor.cs:148)
    AdvancedInspector.AnimationEditor.OnEnable () (at Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs:23)

    I am not sure what the cause can be.. but it could possibly to do with Animation component. When I remove that component and select the gameobject again , it does not cause the error.
     
  22. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Also, when dealing with colliders, I am not 100% certain, but I am pretty sure that I was able to do a mouse drag operation on the values of the collider (ie size etc) to change them.. but now it seems to be forcing me to use scene view interactive option.. (is it correct? , not sure if it is AI doing it or recent Unity update)

    Which I don't mind and do like it.. I think it is better than before.. except that when I make an adjustment in the scene view I can get back the little click-able dots around the collider to move it again. Only way to get it back is to select something else and then select the object again?

    Is think known bug?
     
  23. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Damn, sorry. Always something slipping by.

    If you contact me to admin@lightstrikersoftware.com, I'll provide you with a fixed build right away.

    No... But it is now. I've just checked, and for some reason only the sphere collider appears to work properly in 4.6+, meaning the controller showing up while holding Shift. The other are showing the gizmo on selection and then just disappear.



    Looks like this in Pro with the light box. The white font could be an issue... Or not. Would that be to your liking? Of course, at that point you could take a slightly darker color that would work on both light and dark skin.
     
    Last edited: Feb 17, 2015
  24. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Wow... The new Asset Store tools aren't too friendly. Just discovered the version 1.52 was never properly submitted. Just "uploaded". /facepalm.

    EDIT: Ok, fourth time the charm... Hopefully. Version 1.52 and 1.53 have been merged into 1.52, since it was never properly released in the first place. The changelist for 1.52 includes the fix for the animation component and looks like this;

    • 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.
    • Added support for UnityEvent types.
    • "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.
    • Added support for ALL PropertyDrawer that draws a specific type. This does not include property drawer handling PropertyAttribute.
    • Runtime Attribute can now refer to a property instead of a method.
    • Added the property "MaxDisplayedItems" to the Collection attribute, which trigger the large array display at the size you wish.
    • Added the preference "Max Displayed Items" that is similar to the above property, but in the preference panel.
    • Added the preference for mass expand/collapse of children item. Default is "Alt" key while pressing an expansion arrow.
    • Transform editor shows localEulerAngles instead of localRotation. This property is more friendly with the rotation.
    • Fixed a recursion copy/paste issue.
    • Fixed an throw exception when entering an invalid value in a int/float field.
    • Fixed an issue with the animation component... again.
    • 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.
     
    Last edited: Feb 17, 2015
  25. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    That looks great, actually! The white font could possibly be an issue, but like you said, you can always use a darker color to keep the text readable. Thanks for looking into that for me!
     
  26. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I think I forgot to list it in the changelist, but that change is actually part of the version I've submitted to the store yesterday. (1.52)

    Just mail me if you want it now and not wait for the 3-5 days of store approval.
     
  27. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Sure thing. I think you should still have my email from my last PM, but if you need it again let me know and I'll send it to you again.

    Thanks!
     
  28. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    I got the new version you sent and it works very, very well. Thanks!
     
  29. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Happy to hear that.
     
  30. Shudrum

    Shudrum

    Joined:
    Apr 3, 2011
    Posts:
    63
    Just checkout your inspector without knowing all features ... the nested view is just ... AMAZING !

    Great job ! I love it !
     
  31. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Thanks for the kind word.

    By the way, version 1.52 is now available on the store.
     
  32. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Submitted 1.52a for review. It has the following fixes;

    - Fixed a clamping issue with AnimationCurve.
    - Fixed a multi-selection issue with floats.

    I'm currently working on rewritting the collider scene editors. There was also the request to making an editor for LODGroup, since Unity's one does not support multi-edit. :p
     
  33. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    cool. awaiting for it!
     
  34. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    1.52a is available on the store.
    Version 1.52b have been submitted already.
    It simply fixes an issue where some field would fail to get CTRL+C/CTRL+V commands. I thought that bug was important enough to push a fix right away.
     
  35. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I have mentioned before that "sometimes" I can't enter float value into float property. (I think it was on about collider)

    This has happened again for me. It didn't actually matter what component it was, I could not enter value like 0.5 but 0 , 1 , 2 (int) were fine. The property is definitely a float property because if I turn inspector into a debug mode, I can enter value without problem.

    I "think" it could possibly to do with local issue... maybe depends on what language the window is based on... not sure...
     
  36. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    What if you try to enter "0.5" or "0,5"? If it's a language issue, it might be related to the symbol used.
    Let me know if you remember which exact component it was and if you can find some kind of repro steps.
     
  37. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    1.52b is now available on the store. They were very quick to validate it. :)
     
  38. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    1.52c have been submitted to the store to fix the following;

    • Fixed an issue where dynamic read only attribute would always be read only.
    • Fixed an issue where some specific property drawer *couch*UnityEvent*cough* would keep their data between inspected object. Seriously...

    The last bug was particular annoying. PropertyDrawer got lot of private and internal stuff that aren't really accessible. Asking them to draw where you want using the object you want is no easy task, even more as some of them tend to keep data around.
     
  39. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    When you have mentioned 0,5 (with comma) yeah, that rings a bell! when it didn't work properly, it definitely had comma instead of . Thing is I don't know when and how it happens.
     
  40. BabyDinoHerd

    BabyDinoHerd

    Joined:
    Mar 27, 2014
    Posts:
    21
    Just started using Advanced Inspector and am really enjoying it so far! I just have two questions:

    1. How can I combine other Custom Editors with Advanced Inspector? In particular, I'm using uFrame, which has a custom inspector but also a place where additional fields (that I'm adding on top of the base class) are serialized. I'm not exactly how Advanced Inspector works, but adding the [Inspect] attribute isn't enough, it seems.
    2. In Unity's default Inspector for, say, List<GameObject>, you can drag and drop a multiple-selection from your Project view onto the list to add them all -- is there a way to do this with Advanced Inspector?
    Thanks!
     
  41. LightStriker

    LightStriker

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

    Not sure about uFrame, never tried it. If it has its own custom editor, I would assume it's performing some specific logic in it?

    And for drag and dropping files from your project view, it works like Unity; drag your selection on the label of your collection.
     
  42. BabyDinoHerd

    BabyDinoHerd

    Joined:
    Mar 27, 2014
    Posts:
    21
    Thanks for the quick reply!

    1. Yes, it has a lot of specific logic in it. Basically it generates (from visual node diagrams) code for a base class (with its own custom inspector) that you add on to in your own derived class (which, as a child, uses that custom inspector). But if I add extra field to that, say public GameObject prefabReference; then it gets shown as part of base.OnInspectorGUI().

      But it seems that for AdvancedInspector to work, it needs to be the custom editor of the whole class? So would there be nay way to use AdvancedInspector for the Inspector for these fields? Even if I had to derive a new CustomEditor for each class and specifically call AdvancedInspector somehow in OnInspectorGUI()?

    2. Not sure what I'm doing wrong here. I have a ScriptableObject asset instance with a public List<MonoBehaviourType> prefabList; to store a list of prefabs. But trying to draw and drop prefabs with the MonoBehaviourType component, I just get the "not allowed" icon.

      Now, if I draw-and-drop the MonoBehaviourType component's title in the Inspector, it works, but then I can't multiple-select them in the Project view for things I've saved as Prefabs.
     
  43. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    1. Actually, if you have access to uFrame custom editor, it should be as simple as deriving from InspectorEditor instead of Editor, and calling DrawAdvancedInspector(); instead of DrawDefaultInspector();.

    If you don't have access to their editor... well... there's not much I can do.

    2. Damn. If you do a List<GameObject>, it works. I totally forgot to check for components on those GameObject. I'll fix that.
     
  44. BabyDinoHerd

    BabyDinoHerd

    Joined:
    Mar 27, 2014
    Posts:
    21
    1. Thankfully, I do, and it is as easy as deriving from InspectorEditor. A pretty small change to make even if their files are overwritten by a new version etc.
    2. If you could add this, that would be really excellent -- List<GameObject> would work but it'd be nice to save a little boilerplate code every time.
    Thanks!
     
  45. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Done.
    If you need it right away, mail me at admin@lightstrikersoftware.com, I'll send you the updated package.
     
    OnePxl likes this.
  46. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Is this compatible with Unity5?
     
  47. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    It was with 5.0 RC1. Haven't had time to check with 5.0.0, but it should be.
     
  48. FriendNFoe

    FriendNFoe

    Joined:
    Sep 24, 2012
    Posts:
    11
    Hello, I just got this is and is amazing how much more intuitive handling the editor becomes, great job!

    Something I've noticed is that performance gets pretty low when handling a big number of properties, around 30-40, or just an array of 10-20 items that contains a few properties each

    I get quite a bit of lag when scrolling down on the inspector, almost to the point of not being usable, I guess I could set the script manually only for the classes that I absolutely must have it, but that takes away some of the charm

    any planned optimizations for this?
    thanks!
     
  49. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Always do... But it's a bit on a case-by-case basis. If you can supply me an example that lag, I would be more than happy to see if I can make it run faster.

    Can you also point me to the version of AI and version of Unity you are using?
     
  50. sanjodev

    sanjodev

    Joined:
    May 29, 2012
    Posts:
    63
    For the Enum attribute, is there a way to specifiy the size of the storage type? Currently the Advanced Inspector throws exception because I think it assumes Enums are the same size and tries to cast it the same way. But in my code, I mostly use small enums like:

    public enum Flags : byte
    {
    Wow = 1 << 0,​
    }

    I do it to save some memory in my classes when I don't need that much storage space.