Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[Released] Easy Editor, Enhance your inspector interface

Discussion in 'Assets and Asset Store' started by tgouala-wellfiredLtd, Oct 28, 2015.

  1. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    big-image-cropped.png

    Hi All !

    I am glad to announce the release of Easy Editor, and I would love to get some feedback from you on how the tool could be improved and fit your needs better.

    What is Easy Editor :

    Easy Editor is a handy framework that allows you to drastically decrease the time you spend to create editor interfaces for your MonoBehaviour and ScriptableObject with near to zero coding time.

    EasyEditor is a very light framework and does not reimplement Unity UI or serialization system. It just provides the right architecture to use Unity editor UI and serialization features (PropertyDrawers, SerializedObject, Editor script ...) in the most efficient way. This ensures that any new feature related to the editor provided by Unity can be easily integrated in your project making its maintenance much easier.

    Key features :

    • Organize your different inspector properties into groups.
    • Use attributes to add a group description, add a comment under your properties, layout them, add a button to trigger functions.
    • Insert UI elements inside any group at any position in the inspector.
    • Create buttons in the inspector as fast as lightning by adding a simple attribute [Inspector] on top of any functions, no matter it is in your monobehaviour or in the editor script.
    • Show or hide fields or group of fields with one line of code to create interactive interfaces.
    • Get any asset and folder path just by dragging it in the inspector on a string field.
    • Display information messages under specific conditions like : only in play mode, only if the field is null and required etc...
    • All these features apply for custom class and structure (as long as they are not inside a list, work in progress).
    • Create awesome reorderable arrays where elements can be dragged and inserted at any position in the list (feature provided by Rotorz).
    • Fully compatible with Unity built-in property drawer.
    • Fully compatible with Unity classic way of writing editor script : you can easily render pieces of editor script between any properties already rendered by default in the inspector.
    • A robust framework, easy to understand and well documented that you can extend to meet your needs.

    Now, I would like to know if such a tool meets your interest and if there is any more feature you would be interested in.

    Thanks !

    asset store link : https://www.assetstore.unity3d.com/en/#!/content/45567
     
    Last edited: Dec 28, 2015
  2. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Easy Editor short-term roadmap :

    v1.37 (waiting for review) :

    - Support ScriptableObject.
    - Possibility to add a description under a group header.

    v1.4 (in progress, should be ready in 1 month) :

    - Possibility to create mask enum.
    - Possibility to visualize dictionaries and modify their value (but it won't be serialized).
    - Possibility to display a string as an image in the inspector.
    - Will add various attribute to format password, files locaton, etc...
     
    FireMutant likes this.
  3. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei ,

    With Unity Engine types like Sprites and Texture2ds, any chance of giving preview box of the resource in question and with Sounds say a way to preview play?

    [edit] with Scriptableobjects can't I create a button the save out say a custom list class including dictionaries as a scriptableobject object?
     
    Last edited: Nov 13, 2015
  4. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Duffer123,

    It is not in the roadmap for the moment, but this can definitely be added to the framework. There is so many things that can be added that sometime it is hard to prioritize them :). I will stuck to the roadmap and keep in mind your suggestions for the future.

    Also, keep also in mind that property drawers works with Easy Editor. So if you find a property drawer on the net that can display the texture the way you want, or display a button next to a soundclip to preview it, just insert it in your project and it should work with EE.

    I am not sure to understand this. Could you describe an example ?
     
  5. zullo91

    zullo91

    Joined:
    Nov 1, 2013
    Posts:
    14
    Congrats ! Very useful editor utils ! I love to customize my editor.
    I hope in future updates... :)
     
  6. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei ,

    I think what I meant is with your Asset I can easily create buttons in my custom inspector to say create a scriptableobject (with that script in place) from say a list I've been working on and adding to....

    Since making the last post I've come to realise that Unity can't yet serialise dictionaries. .. :(
     
  7. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    I have in my project used Rotorz Tile System plugin and because you have used Rotorz ReorderableList, then is collision with AssemblyInfo.cs in Tools folder. How can I fix it?

    Best regards,
    AndyGFX
     
  8. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi AndyGFC,

    You can delete the one in Easy Editor folder. In future versions I will remove it.
    Thanks for spotting it !

    Zhoufei
     
  9. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hi there,

    Just bought Easy Editor. It seems like a great lightweight asset to fill the gap in some of the attributes I was having trouble implementing on my own. Really like the options you've included like the layout groups, conditional field display/hide.

    I'm having a strange issue with Color32 fields disappearing after simply right-clicking a script to "Customize Interface". Normally Unity displays a color picker for Color32 fields, but it's not showing up with EE's custom editor. If I change the type to Color, then it displays again. Can you confirm this?

    Also, I noticed in the documentation that the InlineClassRenderer doesn't work inside of Lists, presumably because of the Rotorz list. Do you know of any possibly way to customize this? For example, adjusting label widths, or somehow getting horizontal groups like you demonstrate. Thanks.
     
  10. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Korindian,

    It is solved. You can send your invoice at the support email : egnare.studio@gmail.com it will be a pleasure to send you the last version (with some nice other features)
     
  11. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Indeed, InlineClassRenderer is rendered with unity automatic layout system EditorGUILayout which is not supported inside PropertyDrawers. I am using Rotorz list and its ability to render what propertydrawers can renders, so here it does not support InlineClassRenderer yet.

    For the moment, the serializable class is displayed in the list as Unity would render it and you have no control on the layout. I am looking for a solution and hope to find one in a near future.
     
  12. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei ,

    Does this have any atteibute(s) to show or hide variables/types if enum type has a certain value or is null?
     
  13. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Yes it has. [Visibility(id="theEnumFieldName", value = anEnumValue)]. Enum are value type and cannot be null.

    I can add the possibility to display a field based on the result of a method, then you could display it only if a camera is assigned, or if an object with a specific tag is used, or only if the editor is in Play mode, etc...
     
  14. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Sounds good
     
  15. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hi there. I've been working with the version you sent with the Color32 fix. I have a couple of questions:

    1. Is it possible to have reoderable lists show up within reorderable lists (using a wrapper class because of the way Unity's serialization works with nested lists)?

    2. I'm also having difficulty getting a reorderable list to show up inside of a simple class. For example, look at the following code.

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System;
    4. using System.Collections.Generic;
    5. using EasyEditor;
    6.  
    7. public class SomeClass : MonoBehaviour
    8. {
    9.      
    10.     [Serializable]
    11.     public class TestClass
    12.     {
    13.         [SerializeField] private List<string> testList;
    14.     }
    15.  
    16.     [SerializeField] private TestClass testClass;
    17. }
    Attach the script to a GameObject, right-click the script and Customize Interface, and then notice how the list displays in the regular Unity way, not as a reorderable list. In your examples, I noticed that you were able to achieve this using InlineClassRenderer, but I've tried a few combinations and haven't been able to get this to work.

    What attributes do I need to add to get it to display as a reorderable list?
    Thanks.
     
  16. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Korindian,

    1 - It is not possible for the moment (as mentioned in the description of the product).
    2 - It is a bug. It will work if testClass is public. I will have a look into it today. Hereunder the working code. Thanks for reporting !

    Code (CSharp):
    1. public class SomeClass : MonoBehaviour
    2. {
    3.    
    4.     [System.Serializable]
    5.     public class TestClass
    6.     {
    7.         [SerializeField] private List<string> testList;
    8.     }
    9.  
    10.     [Inspector(rendererType = "InlineClassRenderer")]
    11.     public TestClass testClass;
    12. }
     
  17. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    The bug is fixed in version 1.4 The version has been commited to the Asset Store and will be available soon.
     
  18. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei,

    Just experimenting with this Asset. . It would be great and darn handy if groups (or alternative) were foldable / unfold able. . That would allow us to makes things MUCH tidier when entering big lists of data on the inspector... ?
     
  19. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Just wanted to say thanks for emailing the new version right away with the fix. I left a review in the Asset Store.

    Is there an option to display the index number in the Rotorz lists? Would be handy when each element contains a lot of data vertically, and you collapse it but don't know what's inside that element, as nothing is displayed in the field when it's collapsed.
     
  20. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei,

    I think what I'm referencing above is an easy-to-use attribute doing something akin to EditorGUILayout.Foldout... Could you add that in?
     
  21. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Duffer,

    I integrated it in the version 1.41. It won't be on the asset store for at least one month (the current version pending is 1.4). If you or anybody else are interested just drop us a mail on egnare.studio@gmail.com with your invoice number.
     
  22. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    I send you a screenshot. Can you confirm this is what you are talking about ? If yes, I will ship you the latest version.
    Screen Shot 2015-11-21 at 7.05.51 PM.png
     
  23. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei ,

    Hell, yes please. I'll drop you an email. That foldout functionality is really going to help. Email on its way...
     
  24. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei ,

    Been considering the enum mask example in the beta. Was wondering if it would be possible to use this mask or/xor type logic/value with the Visibility attribute in some way?

    I dunno, something like (using your example .cs):-

    Code (CSharp):
    1. [Visibilty("compatible", (int)compatibleDevice & (int)Compatibility.MacOS")]
    Anyway to do it?

    Also, is there a way to use Attributes to show only a selection of fields within a group rather than doing the Visibility attribute for each field in turn?

    [edit]

    Also, how do I get (in the Inspector) one of those larger boxes for any selected image, sprite or texture2d where I can actually preview the graphics - when I do something like public Sprite icon; ?
     
    Last edited: Nov 21, 2015
  25. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Yes, perfect! It's working well with the 1.41 that you sent. Thanks!
     
  26. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    If anyone is looking to make a simple tab-like interface to show/hide serialized fields, there's a simple way.

    Let's say you have three lists in your MonoBehaviour or ScriptableObject: playerUnits, neutralUnits, enemyUnits. Put an inspector attribute on them:

    Code (CSharp):
    1. [Inspector(group = "SomeGroup")]
    2. public List<string> playerUnits;
    3. public List<string> neutralUnits;
    4. public List<string> enemyUnits;
    Then enter the following in the custom editor code generated by Easy Editor when you right-click the script to customize the interface:

    Code (CSharp):
    1. [Inspector(group = "SomeGroup", order = 1)]
    2. [BeginHorizontal]
    3. private void Player()
    4. {
    5.     ShowRenderer("playerUnits");
    6.     HideRenderer("neutralUnits");
    7.     HideRenderer("enemyUnits");
    8. }
    9.  
    10.  
    11. [Inspector(group = "SomeGroup", order = 2)]
    12. private void Neutral()
    13. {
    14.     HideRenderer("playerUnits");
    15.     ShowRenderer("neutralUnits");
    16.     HideRenderer("enemyUnits");
    17. }
    18.  
    19.  
    20. [Inspector(group = "SomeGroup", order = 3)]
    21. [EndHorizontal]
    22. private void Enemy()
    23. {
    24.     HideRenderer("playerUnits");
    25.     HideRenderer("neutralUnits");
    26.     ShowRenderer("enemyUnits");
    27. }
    Notice the [BeginHorizontal] and [EndHorizontal] attributes on the methods in the custom editor. That determines the horizontal layout of the buttons like tabs. The "order = " is to ensure that the buttons show up above the lists.

    The only drawback to this is that when the MonoBehaviour/ScriptableObject first show up in the inspector, all the lists display. By clicking one of the buttons though, you can show only what you need to.

    The new folding groups that zhoufei is developing is a simple alternative to this that doesn't require any code in the custom editor, but the group dropdowns display vertically.
     
  27. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Korindian,

    Groups can be foldable in the last version, but I pretty like this tab interface which make the inspector even easier to read. I remember a user told me he would like to have a tab interface integrated to Easy Editor. I told him I wanted to keep the tool as simple as possible to ensure maintainability so would not implement it. But here you come with a pretty nit solution and this is what is magic with communities :)

    Actually, you can force to display only one list when the inspector first show up by overriding OnEnable in the inspector script. But calling base.OnEnable() is very important. Here the code :
    Code (CSharp):
    1. [Groups("Character Type")]
    2. [CustomEditor(typeof(TabMono))]
    3. public class TabMonoEditor : EasyEditorBase
    4. {
    5.     new public void OnEnable()
    6.     {
    7.         base.OnEnable();
    8.  
    9.         Player();
    10.     }
    11.  
    12.     [Inspector(group = "Character Type", order = 1)]
    13.     [BeginHorizontal]
    14.     private void Player()
    15.     {
    16.         ShowRenderer("playerUnits");
    17.         HideRenderer("neutralUnits");
    18.         HideRenderer("enemyUnits");
    19.     }
    20.    
    21.    
    22.     [Inspector(group = "Character Type", order = 2)]
    23.     private void Neutral()
    24.     {
    25.         HideRenderer("playerUnits");
    26.         ShowRenderer("neutralUnits");
    27.         HideRenderer("enemyUnits");
    28.     }
    29.    
    30.    
    31.     [Inspector(group = "Character Type", order = 3)]
    32.     [EndHorizontal]
    33.     private void Enemy()
    34.     {
    35.         HideRenderer("playerUnits");
    36.         HideRenderer("neutralUnits");
    37.         ShowRenderer("enemyUnits");
    38.     }
    39. }
     
  28. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Also, if each of your tab contains several properties. You can put them in the same group without header ( [Inspector("my Group", displayHeader = false)] to hide them all at once.

    I attached the scripts to illustrate it.
     

    Attached Files:

  29. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Duffer,

    - For the enum mask I will definitely make it possible. I will update you as soon as it is ready (in the next two days).
    - For hiding a group of fields with an attribute, I first need to consider how to do it without hurting the simplicity of the tool. If I find a nit way, I will implement it.
    - There is no functionality integrated in Easy Editor to preview texture2d, Sprite or Image. And I don't think Unity does it by default. With EasyEditor [Image] attribute you can display a texture from its path (string). I wrote an editor script to display this image in the inspector but I am not sure this is what you want. I attach the code that may help you. If not, describe a bit more what you are trying to do, maybe I can add a new functionality to EE.
     

    Attached Files:

  30. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Cool! Will use something like this. I didn't think of the OnEnable part to display only one on first view of the inspector, that's good to know.
     
  31. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Duffer,

    I shared with you the last version that implement the possibility to display a ui element based on the boolean value return by a function (allowing to do operation with enum mask).

    For other users, don't hesitate to drop me a mail if you want it before it is on the asset store (will be probably in around one month).

    For grouping fields in order to hide it together, I am still considering different solution, but I am not quite satisfied with them for the moment. If you have any solution in mind, let me know !
     
  32. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei,

    Thanks. . I should feed back that the beta you sent me also works like a charm.

    Perhaps 'VisibilityStart' and VisibilityEnd attributes?
     
  33. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    @zhoufei
    Since Easy Editor requires inserting some customized snippets (e.g. [Inspector(group = "GroupA")]) into our source code. Does that mean the final compiled project (production build) will contain Easy Editor logic? Or, it will not contain Easy Editor logic since Unity compiler/builder automatically ignores all editor/inspector logic, and prevent any editor/inspector logic going into final production build?
     
    Last edited: Nov 25, 2015
  34. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Dan,

    None of Easy Editor logic go into your build. The only thing that will go into your build is few attributes that does not have logic in it. There are exactly equivalent to : [SerializedField], [Tooltip] etc... so no worry about this.

    It means, if you delete the folder EasyEditor and remove these attributes, your project will run EXACTLY the same way.

    Easy Editor does not change anything to standard Unity serialization system. This is why the first focus is about rendering what unity serializes and nothing else. This is also the reason why Easy Editor has zero impact on the build performances.

    Dictionaries are not serialized by Unity for the moment. The day it will, I will add it for sure. I received some request to display dictionnaries in the inspector. I think it can be useful for debugging purpose, so I added it to the roadmap, but this is not the first focus, so I cannot ensure when this functionality will be available.
     
  35. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    Understood.
    Thanks! :)
     
  36. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Any way to get the OnClick to show up while using Easy Editor?

    Code (csharp):
    1.  
    2. [System.Serializable]
    3. public class ButtonClickedEvent : UnityEvent { }
    4.  
    5. public class menuButton : MonoBehaviour, IPointerEnterHandler, IPointerClickHandler{
    6.     [FormerlySerializedAs("onClick")]
    7.     [SerializeField]
    8.     private ButtonClickedEvent m_OnClick = new ButtonClickedEvent();
    9.  
    10.     public ButtonClickedEvent onClick
    11.     {
    12.         get { return m_OnClick; }
    13.         set { m_OnClick = value; }
    14.     }
    15.  
    This works for me if I don't use Easy Editor, but if I use easy editor the ButtonClickedEvent won't show up in the inspector :/
     
  37. RealityDotStop

    RealityDotStop

    Joined:
    Mar 4, 2013
    Posts:
    42
    I've had 1.4 (didn't use prior versions) blow up on a MonoBehaviour immediately after customizing the interface and showing the script in the inspector. I've isolated it down to a particular 3rd party script that was being referenced as a public variable. I didn't need it to be public, so it's not a show stopper at the moment, but it may some day.




    I can't directly post the script since it's from a 3rd party script, but I'll be happy to show you, zhuofei.
     
  38. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Daniel,

    I am so sorry for the late reply, for some reason gmail is putting the new post on this thread in the wrong mailbox...
    Event is something we are not often using here and that we missed in Easy Editor. But we will support it as fast as possible.
     
  39. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Pixel Hero,
    I am so sorry for the late reply, for some reason gmail is putting the new post on this thread in the wrong mailbox...

    Could you send the script to egnare.studio@gmail.com ? If your code is private, maybe you can isolate the part of the script that creates this error before to send it to me ?
     
  40. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Daniel,

    The event appears in the inspector on my side in Unity 4.6.8
    Which version of unity are you using ?

    Here the code :
    Code (CSharp):
    1. [System.Serializable]
    2.     public class ButtonClickedEvent : UnityEvent{}
    3.  
    4.     public class EasyEditorEnnemy : MonoBehaviour
    5.     {
    6.         [SerializeField]
    7.         private ButtonClickedEvent m_OnClick = new ButtonClickedEvent();
    8.  
    9.         [Image]
    10.         public string easyEditorImage = "Assets/EasyEditor/Examples/icon.png";
    11.  
    event.png
     
  41. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Huh interesting, it actually worked now o_O don't know what I was doing wrong before, thanks for the reply anyways \o
     
  42. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei ,

    Just to feed in, I am finding it quite limiting not being able to use the EasyEditor attributes (like Visibility) in non-Monobehavior/Scriptableobject classes which I am then pulling in to a ScriptableObject... and the like.

    Say if I had a Scriptableobject item class. Within that class (which did have an associated EasyEditor file) I would pull in a ItemCommonFlags (can't be either Monobehavior or Scriptableobject as I want to drill in to it within the Item class) class. I've got plenty of Flag bools in that ItemCommonFlags class. I could make them much simpler if I invoked one of your attributes - and use Custom Interface - but your attributes have no effect (perhaps because I can't create the associated EasyEditor class with Custom Interface)?

    It would be SO useful if I could use your useful Attributes in a non-Monobehavior / non-Scriptableobject class which then plays through and is within either a Monobehavior or Scriptableobject class...

    I hope you get what I am saying? :)
     
  43. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Duffer,

    I kind of get what you mean. This is already supported for serializable classes and structures as long as they are not contained in a list (see NestedClasses example and rendererType = "InlineClassRenderer").

    Could you give more details of what you are trying to do ?
    Thanks.
     
  44. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei ,

    I'll try and give you an idea with some code excerpts:-

    So here is the non-Monobehavior class:-

    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using EasyEditor;
    6.  
    7. [Serializable]
    8. public class ItemCommonFlags {
    9.  
    10.     public bool isStackable = false;
    11.  
    12.     public bool isWeapon = true;
    13.  
    14.     public bool isAmmunition = false;
    15.  
    16.     public bool isUnlimitedAmmunition = false;
    17.  
    18.     public bool isConsumable = false;
    19.  
    20.     public bool isRespawnable = false;
    21.  
    22.     public bool isGrowable = false;
    23.  
    24.     public bool isRegrowable = false;
    25.  
    26.     public bool isOrganic = false;
    27.  
    28.     public bool isManufactured = true;
    29.  
    30.     public bool isEdible = false;
    31.  
    32.     public bool isFoodPreparable = false;
    33.  
    34.     public bool isDrinkable = false;
    35.  
    36.     public bool isDrinkPreparable = false;
    37.  
    38.     public bool isCodeable = false;
    39.  
    40.     public bool isSpokenCodeable = false;
    41.  
    42.     public bool isActivatable = false;
    43.  
    44.     public bool isCodeActivatable = false;
    45.  
    46.     public bool isKeyActivatable = false;
    47.  
    48.     public bool isFuelReliant = false;
    49.  
    50.     public bool isPortal = false;
    51.  
    52.     public bool isTeleporter = false;
    53.  
    54.     public bool isDoor = false;
    55.  
    56.     public bool isKey = false;
    57.  
    58.     public bool isSkeletonKey = false;
    59.  
    60.     public bool isUseable = false;
    61.  
    62.     public bool isTool = false;
    63.  
    64.     public bool isFishingTool = false;
    65.  
    66.     public bool isBait = false;
    67.  
    68.     public bool isCookingTool = false;
    69.  
    70.     public bool isAlchemicalTool = false;
    71.  
    72.     public bool isCraftingTool = false;
    73.  
    74.     public bool isSmithingTool = false;
    75.  
    76.     public bool isMasonryTool = false;
    77.  
    78.     public bool isCarpentryTool = false;
    79.  
    80.     public bool isUtensil = false;
    81.  
    82.     public bool isKitchenUtensil = false;
    83.  
    84.     public bool isEatingUtensil = false;
    85.  
    86.     public bool isDevice = false;
    87.  
    88.     public bool isDevicePart = false;
    89.  
    90.     public bool isPuzzle = false;
    91.  
    92.     public bool isPuzzlePart = false;
    93.  
    94.     public bool isMachine = false;
    95.  
    96.     public bool isMachinePart = false;
    97.  
    98.     public bool isPowered = false;
    99.  
    100.     public bool isPoweredByElectricity = false;
    101.  
    102.     public bool isPoweredByCoal = false;
    103.  
    104.     public bool isPoweredByOil = false;
    105.  
    106.     public bool isPoweredByLight = false;
    107.  
    108.     public bool isPoweredByEnergy = false;
    109.  
    110.     public bool isPoweredByFuel = false;
    111.  
    112.     public bool isPoweredByMagick = false;
    113.  
    114.     public bool isPoweredBySpirit = false;
    115.  
    116.     public bool isMoveable = true;
    117.  
    118.     public bool isLiftable = true;
    119.  
    120.     public bool isPushable = true;
    121.  
    122.     public bool isPullable = true;
    123.  
    124.     public bool isOpenable = false;
    125.  
    126.     public bool isClosable = false;
    127.  
    128.     public bool isLockable = false;
    129.  
    130.     public bool isUnlockable = false;
    131.  
    132.     public bool isJammable = false;
    133.  
    134.     public bool isUnjammable = false;
    135.  
    136.     public bool isStorable = true;
    137.  
    138.     public bool isConveyable = true;
    139.  
    140.     public bool isCarriable = true;
    141.  
    142.     public bool isPackable = true;
    143.  
    144.     public bool isPlaceable = true;
    145.  
    146.     public bool isEquipable = false;
    147.  
    148.     public bool isWearable = false;
    149.  
    150.     public bool isArmour = false;
    151.  
    152.     public bool isSolid = true;
    153.  
    154.     public bool isLiquid = false;
    155.  
    156.     public bool isWater = false;
    157.  
    158.     public bool isBeverage = false;
    159.  
    160.     public bool isSoup = false;
    161.  
    162.     public bool isAlcoholicBeverage = false;
    163.  
    164.     public bool isAlcoholicSpirit = false;
    165.  
    166.     public bool isGaseous = false;
    167.  
    168.     public bool isPotion = false;
    169.  
    170.     public bool isInk = false;
    171.  
    172.     public bool isDye = false;
    173.  
    174.     public bool isChemical = false;
    175.  
    176.     public bool isRadioactive = false;
    177.  
    178.     public bool isAlkali = false;
    179.  
    180.     public bool isAcid = false;
    181.  
    182.     public bool isPoison = false;
    183.  
    184.     public bool isDisease = false;
    185.  
    186.     public bool isAntidote = false;
    187.  
    188.     public bool isCure = false;
    189.  
    190.     public bool isToxin = false;
    191.  
    192.     public bool isAntitoxin = false;
    193.  
    194.     public bool isVenom = false;
    195.  
    196.     public bool isSerum = false;
    197.  
    198.     public bool isTouchable = true;
    199.  
    200.     public bool isValuable = true;
    201.  
    202.     public bool isCurrency = false;
    203.  
    204.     public bool isHoldable = true;
    205.  
    206.     public bool isTastable = false;
    207.  
    208.     public bool isSmellable = false;
    209.  
    210.     public bool isWeightless = false;
    211.  
    212.     public bool isBuoyant = false;
    213.  
    214.     public bool isAerodynamic = false;
    215.  
    216.     public bool isElectricConductive = true;
    217.  
    218.     public bool isHeatConductive = true;
    219.  
    220.     public bool isCoolable = true;
    221.  
    222.     public bool isFreezable = false;
    223.  
    224.     public bool isHeatable = true;
    225.  
    226.     public bool isIgniter = false;
    227.  
    228.     public bool isBurnable = false;
    229.  
    230.     public bool isFire = false;
    231.  
    232.     public bool isCookFire = false;
    233.  
    234.     public bool isTorch = false;
    235.  
    236.     public bool isLightSource = false;
    237.  
    238.     public bool isMeltable = true;
    239.  
    240.     public bool isThrowable = true;
    241.  
    242.     public bool isCatchable = true;
    243.  
    244.     public bool isBuyable = true;
    245.  
    246.     public bool isSellable = true;
    247.  
    248.     public bool isLootable = true;
    249.  
    250.     public bool isFindable = true;
    251.  
    252.     public bool isRarityEffected = true;
    253.  
    254.     public bool isSolidContainer = false;
    255.  
    256.     public bool isFluidContainer = false;
    257.  
    258.     public bool isUnlimitedContainer = false;
    259.  
    260.     public bool isFluidStopper = false;
    261.  
    262.     public bool isAmmoHolder = false;
    263.  
    264.     public bool isUnlimitedAmmoHolder = false;
    265.  
    266.     public bool isFuelHolder = false;
    267.  
    268.     public bool isUnlimitedFuelHolder = false;
    269.  
    270.     public bool isSolidContainable = true;
    271.  
    272.     public bool isFluidContainable = false;
    273.  
    274.     public bool isDroppable = true;
    275.  
    276.     public bool isMinable = false;
    277.  
    278.     public bool isSmeltable = false;
    279.  
    280.     public bool isFishable = false;
    281.  
    282.     public bool isRefinable = false;
    283.  
    284.     public bool isAlchemical = false;
    285.  
    286.     public bool isDeconstructable = false;
    287.  
    288.     public bool isConstructable = true;
    289.  
    290.     public bool isTrappable = false;
    291.  
    292.     public bool isComponent = false;
    293.  
    294.     public bool isSlottable = false;
    295.  
    296.     public bool isUnlimitedSlottable = false;
    297.  
    298.     public bool isSlotItem = false;
    299.  
    300.     public bool isGemSlotItem = false;
    301.  
    302.     public bool isBoundSpiritSlotItem = false;
    303.  
    304.     public bool isRunestoneSlotItem = false;
    305.  
    306.     public bool isGlyphSlotItem = false;
    307.  
    308.     public bool isWardSlotItem = false;
    309.  
    310.     public bool isFettishSlotItem = false;
    311.  
    312.     public bool isTalismanSlotItem = false;
    313.  
    314.     public bool isUpgradable = true;
    315.  
    316.     public bool isDegradable = true;
    317.  
    318.     public bool isPaper = false;
    319.  
    320.     public bool isSignage = false;
    321.  
    322.     public bool isParchment = false;
    323.  
    324.     public bool isScroll = false;
    325.  
    326.     public bool isBook = false;
    327.  
    328.     public bool isTome = false;
    329.  
    330.     public bool isGrimoire = false;
    331.  
    332.     public bool isScribable = true;
    333.  
    334.     public bool isPaintable = false;
    335.  
    336.     public bool isDyeable = false;
    337.  
    338.     public bool isBreakable = true;
    339.  
    340.     public bool isDestroyable = true;
    341.  
    342.     public bool isImprovable = true;
    343.  
    344.     public bool isQualityRelated = true;
    345.  
    346.     public bool isStitchable = false;
    347.  
    348.     public bool isEnchantable = true;
    349.  
    350.     public bool isSharpenable = true;
    351.  
    352.     public bool isBluntable = true;
    353.  
    354.     public bool isNotchable = true;
    355.  
    356.     public bool isBendable = true;
    357.  
    358.     public bool isBrittle = false;
    359.  
    360.     public bool isShatterable = false;
    361.  
    362.     public bool isSnappable = true;
    363.  
    364.     public bool isDentable = false;
    365.  
    366.     public bool isUndentable = false;
    367.  
    368.     public bool isScratchable = true;
    369.  
    370.     public bool isPolishable = true;
    371.  
    372.     public bool isMarrable = true;
    373.  
    374.     public bool isHardenable = true;
    375.  
    376.     public bool isSoftenable = true;
    377.  
    378.     public bool isSpellContainerAble = true;
    379.  
    380.     public bool isSpellContainerTemporary = true;
    381.  
    382.     public bool isSpellContainerOnceOnly = false;
    383.  
    384.     public bool isSpellContainerRechargeable = false;
    385.  
    386.     public bool isSkillBookAble = true;
    387.  
    388.     public bool isSkillBookOneShot = true;
    389.  
    390.     public bool isChargable = true;
    391.  
    392.     public bool isDischargable = true;
    393.  
    394.     public bool isUnlimitedCharge = false;
    395.  
    396.     public bool isWardable = true;
    397.  
    398.     public bool isCursable = true;
    399.  
    400.     public bool isBlessable = true;
    401.  
    402.     public bool isItemThatCanBeSlayer = true;
    403.  
    404.     public bool isItemThatCanBeGreatSlayer = true;
    405.  
    406.     public bool isRunable = true;
    407.  
    408.     public bool isSignable = true;
    409.  
    410.     public bool isSigilable = true;
    411.  
    412.     public bool isTalismanable = true;
    413.  
    414.     public bool isGlyphable = true;
    415.  
    416.     public bool IsOghmable = true;
    417.  
    418.     public bool isHexable = true;
    419.  
    420.     public bool isFettishable = true;
    421.  
    422.     public bool isRitualable = true;
    423.  
    424.     public bool isTransmutable = true;
    425.  
    426.     public bool isBindable = true;
    427.  
    428.     public bool isIntelligent = false;
    429.  
    430.     public bool isHoliable = true;
    431.  
    432.     public bool isUnholiable = true;
    433.  
    434.     public bool isModifiableOfAttributes = true;
    435.  
    436.     public bool isModifiableOfAbilities = true;
    437.  
    438.     public bool isReputationable = true;
    439.  
    440.     public bool isAgeRelatable = true;
    441.  
    442.     public bool isMythRelatable = true;
    443.  
    444.     public bool isItemThatCanCarryElement = true;
    445.  
    446. }
    447.  
    I'm exaggerating - you can see why I'd like to use some Visibility and other attributes above!

    Then I'm pulling it in as a type in my scriptableobject class here (see towards the bottom of the code in the Item class):-

    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using EasyEditor;
    6.  
    7. [Serializable]
    8. public enum ItemTypes
    9. {
    10.     Weapon,
    11.     Ammunition,
    12.     Armour,
    13.     Shield,
    14.     Helm,
    15.     Currency,
    16.     Hat,
    17.     Apparrel,
    18.     Cloak,
    19.     Ring,
    20.     Necklace,
    21.     Broach,
    22.     Jewellery,
    23.     Gem,
    24.     Runestone,
    25.     Foodstuff,
    26.     Food,
    27.     Drink,
    28.     Potion,
    29.     Consumable,
    30.     Container,
    31.     Chest,
    32.     Bag,
    33.     Store,
    34.     Bottle,
    35.     Door,
    36.     Portal,
    37.     Key,
    38.     Device,
    39.     MusicalInstrument,
    40.     Component,
    41.     Trap,
    42.     Liquid,
    43.     Poison,
    44.     Disease,
    45.     Paper,
    46.     Ink,
    47.     Metal,
    48.     Ore,
    49.     Textile,
    50.     Ingredient,
    51.     Adjunct,
    52.     Herb,
    53.     Plant,
    54.     Apparatus,
    55.     Chair,
    56.     Bed,
    57.     Table,
    58.     Wall,
    59.     Bridge,
    60.     Shelter,
    61.     Collectible,
    62.     Fire,
    63.     Torch,
    64.     Vehicle
    65. }
    66.  
    67. [Serializable]
    68. public class Item : ScriptableObject {
    69.  
    70.     public int itemID = 1;
    71.  
    72.     public string itemName = "Default Name";
    73.  
    74.     public ItemTypes itemType = ItemTypes.Weapon;
    75.  
    76.     public int itemLevel = 1;
    77.  
    78.     public ItemDescriptives itemDescriptives;
    79.  
    80.     public ItemPrimaryResources itemPrimaryResources;
    81.  
    82.     public ItemCommonFlags itemCommonFlags;
    83. }
    84.  
    If I make the ItemCommonFlags class a Monobehavior, I can have my custom interface and I think I can then use the attributes - however, it matters not a jot because when I have the Item scriptableobject class in the Inspector all I get is the drag and drop ItemCommonFlags class and I cannot drill down to the internal flags...

    I hope this makes some more sense now.
     
  45. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    Hi Duffer,

    I understand what you mean. What you want to do is to display ItemCommonFlags object directly inside the ScriptableObject and use EasyEditor attribute in it to have more control on how elements are displayed.

    This is supported by EasyEditor. You just need to write :

    Code (CSharp):
    1. [Serializable]
    2. public class Item : ScriptableObject {
    3.  
    4.     public int itemID = 1;
    5.  
    6.     public string itemName = "Default Name";
    7.  
    8.     public ItemTypes itemType = ItemTypes.Weapon;
    9.  
    10.     public int itemLevel = 1;
    11.  
    12.     public ItemDescriptives itemDescriptives;
    13.  
    14.     public ItemPrimaryResources itemPrimaryResources;
    15.     [Inspector(rendererType = "InlineClassRenderer")]
    16.     public ItemCommonFlags itemCommonFlags;
    17. }
    18.  
    Let me know if this solves your problem.
     
  46. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Excellent! Going out soon but will give it a whirl later. . Thanks.
     
  47. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @zhoufei ,

    It didn't work... :(

    Is there anything more I need to put with the ItemCommonFlags class as well?
     
  48. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Scratch that... It now works. . I had a vestigial editor.. Cs associated with the ItemCommonFlags cs file.
     
  49. tgouala-wellfiredLtd

    tgouala-wellfiredLtd

    Joined:
    Jun 8, 2013
    Posts:
    99
    It's a good news :)

    By the way, I would like to open a blog where I can write some tips about what can be made with EE. I need a blog platform that can display C# code easily. Do you have any suggestion?
     
  50. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    I'm not sure. Can you boil it down and put as a tabbed page on your website?