Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assets [Free][Open Source] Stackable Decorator - property drawer with multiple stackable decorator

Discussion in 'Works In Progress - Archive' started by lokinwai, Jan 30, 2018.

  1. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    [ Asset Store ] - [ Github ] - [ Wiki (Docs) ]

    small.png

    Stackable Decorator is a set of property drawers which allow you to stack multiple decorators on it, each decorator also modifies all stacked decorators and drawers.

    For example, a box decorator stacked on a property field, it draws a padded box background on the field. If a color decorator stacked on, the color of the box will be changed. Then, a heading decorator stacked on, a heading is drawn above the boxed field.

    Code (CSharp):
    1. [Heading(title = "Heading", order = 2)]
    2. [Color(0.5f, 0.5f, 1f, 1, order = 1)]
    3. [Box(2, 2, 2, 2)]
    4. [StackableField]
    5. public string field;
    Sample.png

    Stackable Decorator is current in beta, more feature will be added.

    Please read the wiki for the document of property drawers and decorators.

    Stackable Decorator is open source and hosted at Github.
     
    Last edited: Mar 6, 2018
    Paulo_Mattos, ZiadJ, Peter77 and 3 others like this.
  2. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    This illustration show how this system work:
    upload_2018-1-31_18-7-40.png
    A decorate stacked over will modify the drawer or decorate under it.

    This is the code and the result:
    Code (CSharp):
    1. [Color(0.5f, 0.5f, 1, 1, order = 3)]
    2. [Box(4, 4, 4, 4, order = 2)]
    3. [Color(1, 0.5f, 0.5f, 1, order = 1)]
    4. [StackableDrawer]
    5. public int value = 1;
    upload_2018-1-31_18-11-3.png
    Because the order of attributes have no guarantees, so need to specify the order.
     
    alexanderameye likes this.
  3. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Looks cool! Personally I would never actually use this though since I try to go for a Unity-native feel when creating my custom editors.
     
    hippocoder likes this.
  4. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    The screenshot is just for eye-catching, you still can make native feel layout:
    upload_2018-2-1_17-12-14.png
     
    alexanderameye likes this.
  5. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Written an attribute to validate object:

    2018-02-04 07-02-27.gif

    Code (CSharp):
    1. [NotNull]
    2. [AssetOnly]
    3. [StackableDrawer]
    4. public GameObject gameObject1;
    It can check null, asset only and scene object only.
     
  6. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Finished the dynamic condition:

    2018-02-05 04-45-06.gif

    Code (CSharp):
    1. [ValidateValue("%1 more than 50", "#CheckValue", messageType = MessageType.Warning)]
    2. [Slider(0, 100)]
    3. public int[] Value;
    4.  
    5. public bool CheckValue(int value)
    6. {
    7.     return value <= 50;
    8. }
     
  7. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Can use dynamic string for title and label now:

    2018-02-05 16-47-42.gif

    Code (CSharp):
    1. [Heading(top: 8, title = "#GetHeader", order = 2)]
    2. [HorizontalGroup("Group", "a", -1, 62, margin = 4, order = 1)]
    3.  
    4. [Group("Left", "first,second"), StackableDrawer]
    5. public Vector3 vector;
    6. [InGroup("Left"), StackableDrawer]
    7. public GameObject first;
    8. [InGroup("Left"), StackableDrawer]
    9. public GameObject second;
    10.  
    11. [InGroup("Group", order = 2)]
    12. [Group("Right", "b", order = 1), Label(12, title = "#GetLabel"), StackableDrawer]
    13. public int a;
    14. [InGroup("Right"), Label(12, title = "#GetLabel"), StackableDrawer]
    15. public int b;
    16.  
    17. public string GetHeader(Vector3 value)
    18. {
    19.     var result = value.y >= 0 ? "Upper" : "Lower";
    20.     result += value.x < 0 ? " Left" : " Right";
    21.     return result;
    22. }
    23.  
    24. public string GetLabel(int value)
    25. {
    26.     return value >= 0 ? "P" : "N";
    27. }
     
    rogueknight likes this.
  8. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    EnumButton show the choose as button group:

    upload_2018-2-7_14-49-55.png

    Show EnumButton with multiple row:

    upload_2018-2-7_14-59-7.png

    Single column with other layout:

    upload_2018-2-7_15-2-25.png
     
    MostHated likes this.
  9. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    EnumMaskButton can be used with combined flag:

    2018-02-07 17-27-12.gif

    Code (CSharp):
    1. public enum ColorMask { R = 1, G = 2, B = 4, A = 8, RGB = R | G | B, RGBA = RGB | A }
    2.  
    3. [EnumMaskButton(all = false)]
    4. public ColorMask colorMask;
    5.  
    6. public enum Direction { X = 1, Y = 2, Z = 4 }
    7.  
    8. [EnumMaskButton(style = "toggle")]
    9. public Direction direction;
     
  10. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Finished preview, popup editor and inline property:

    2018-02-09 11-54-38b.gif

    2018-02-09 12-18-03.gif

    Custom editor only work on layout system, but property drawer only work on non-layout system, so inline editor cannot be implemented. :(
     
  11. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Here are introduction to some finided decorate:

    Code (CSharp):
    1. [Heading(top: 8, title = "Header", order = 4)]
    2. [Color(0.5f, 0.5f, 1, 1, order = 3)]
    3. [Box(4, 4, 4, 4, order = 2)]
    4. [Color(1, 1, 1, 1, order = 1)]
    5. [Label(title = "Text")]
    6. [StackableDrawer]
    7. public string value;
    8.  
    9. [Heading(top: 8, order = 5)]
    10. [Heading(width = -1, title = "Footer", alignment = TextAlignment.Right, below = true, style = "box", order = 4)]
    11. [Color(0.5f, 0.5f, 1, 1, order = 3)]
    12. [Box(-14, -4, 8, 8, order = 2)]
    13. [Color(1, 1, 1, 1, order = 1)]
    14. [Label(-1, title = "Text")]
    15. [StackableDrawer]
    16. public string value2;
    Color: modify following decorate's color.
    Box: draw a box (or other style) surround following decorate.
    Heading: draw a label above or below. Use for header, footer or separator.
    Label: change the width, text, icon and tooltip of prefix label.

    upload_2018-2-10_10-39-2.png
     
  12. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Group decorate can group multi properties together:

    Code (CSharp):
    1. [Box(4, 4, 4, 4, order = 2)]
    2. [Group("group1", 2)]
    3. [StackableDrawer]
    4. public int number1;
    5. [InGroup("group1"), StackableDrawer]
    6. public int number2;
    7. [InGroup("group1"), StackableDrawer]
    8. public int number3;
    Above code group the following 2 properties together.
    InGroup attribute is used to hide the property outside the group, so it only show in the group.

    upload_2018-2-11_14-35-47.png

    Code (CSharp):
    1. [Group("group1", false, "number3,number2")]
    Pass the name list to use different order or the properties is not followed the original.

    upload_2018-2-11_14-39-42.png

    Code (CSharp):
    1. [Box(4, 4, 4, 4, order = 2)]
    2. [Group("child", true, "", self = false)]
    3. [StackableDrawer]
    4. public children child;
    5.  
    6. [Serializable]
    7. public class children
    8. {
    9.     public bool check;
    10.     public string text;
    11.     public int number;
    12. }
    It also can auto group child properties together.

    upload_2018-2-11_14-45-41.png
     
  13. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    HorizontalGroup is almost same as Group, but arrange the field in horizontal.

    upload_2018-2-12_18-58-28.png

    Code (CSharp):
    1. [Box(4, 4, 4, 4, order = 2)]
    2. [HorizontalGroup("child", true, "", 20, -1, -1, self = false)]
    3. [StackableDrawer]
    4. public children child;
    5.  
    6. [Serializable]
    7. public class children
    8. {
    9.     [Label(0), StackableDrawer]
    10.     public bool check;
    11.     [Label(-1), StackableDrawer]
    12.     public string text;
    13.     [Label(-1), StackableDrawer]
    14.     public int number;
    15. }
     
  14. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Foldout attribute make the field under the foldout:

    upload_2018-2-13_12-29-41.png

    Code (CSharp):
    1. [Foldout(title = "Group")]
    2. [StackableDrawer]
    3. public string text;
    Use with group to have a foldout group:

    2018-02-13 12-33-22.gif

    Code (CSharp):
    1. [Foldout(title = "Group")]
    2. [Group("foldout", false, "text2,text3")]
    3. [StackableDrawer]
    4. public string text1;
    5. [InGroup("foldout"), StackableDrawer]
    6. public string text2;
    7. [InGroup("foldout"), StackableDrawer]
    8. public string text3;
     
    lightbug14 and Peter77 like this.
  15. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    TabGroup attribute group multi field under different tabs:

    2018-02-14 05-54-23.gif

    Code (CSharp):
    1. [TabGroup("tab", "Tab1,Tab2", "tab2a", order = 1)]
    2.  
    3. [Group("tab1", 2), StackableDrawer]
    4. public string tab1a;
    5. [InGroup("tab1"), StackableDrawer]
    6. public string tab1b;
    7. [InGroup("tab1"), StackableDrawer]
    8. public string tab1c;
    9.  
    10. [InGroup("tab", order = 1)]
    11. [Group("tab2", 2), Slider(0, 100)]
    12. public int tab2a;
    13. [InGroup("tab2"), Slider(0, 100)]
    14. public int tab2b;
    15. [InGroup("tab2"), Slider(0, 100)]
    16. public int tab2c;
     
    Peter77 likes this.
  16. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Some conditional attribute :

    EnableIf: enable with condition
    ShowIf: show with condition
    HelpBox: show help box with condition

    2018-02-16 06-27-25.gif

    Condition can be SerializedProperty, or field/property/method.

    Code (CSharp):
    1. public bool enable;
    2. [EnableIf("$enable")]
    3. [StackableDrawer]
    4. public int test1;
    5. [ShowIf("#Visible")]
    6. [StackableDrawer]
    7. public int test2;
    8. [HelpBox("Value is negative", "#CheckValue")]
    9. [StackableDrawer]
    10. public int test3;
    11.  
    12. public bool Visible()
    13. {
    14.     return test1 >= 0;
    15. }
    16.  
    17. public bool CheckValue(int Value)
    18. {
    19.     return Value < 0;
    20. }
    Here is the example to combine several attribute to create a enable group:

    2018-02-16 06-30-06.gif

    Code (CSharp):
    1. [Box(4, 4, 4, 6, style = "ChannelStripBg", order = 2)]
    2. [Group("enable group", 1), ToggleLeft]
    3. public bool group;
    4. [ShowIf("$group", order = 2)]
    5. [InGroup("enable group", order = 1)]
    6. [Group("enable group children", 2), StackableDrawer]
    7. public string group1;
    8. [InGroup("enable group children"), StackableDrawer]
    9. public string group2;
    10. [InGroup("enable group children"), StackableDrawer]
    11. public string group3;
     
  17. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Buttons attribute add a button group to the field:

    2018-02-18 06-11-17.gif

    Buttons add on above or below.
    SideButtons add on left or right.

    Code (CSharp):
    1. [Buttons(titles = "Button1,Button2,Button3", actions = "Button1,Button2,Button3")]
    2. [StackableDrawer]
    3. public string button;
    4.  
    5. public void Button1() { button = "Button1"; }
    6. public void Button2() { button = "Button2"; }
    7. public void Button3() { button = "Button3"; }
    8.  
    9. [SideButtons(titles = "+,-", actions = "Inc,Dec")]
    10. [StackableDrawer]
    11. public int num;
    12.  
    13. public void Inc() { num++; }
    14. public void Dec() { num--; }
     
  18. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Image attribute draw a texture above or below.
    SideImage draw on left or right.

    upload_2018-2-18_15-22-6.png

    Code (CSharp):
    1. [Image(image = "Assets/Textures/Heart.png", width = 32, height = 32)]
    2. [StackableDrawer]
    3. public string image;
    4.  
    5. [SideImage(texture = "$", width = 16, height = 16)]
    6. [StackableDrawer]
    7. public Texture image2;
     
    Peter77 likes this.
  19. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    Could you add support to specify an asset guid, rather than the asset path? Such as:
    Code (CSharp):
    1. [Image(guid = "259295351460acf4c955e64122bd204f", width = 32, height = 32)]
    I use guid's rather than paths, because this allows to reorganize the project (move assets etc) without breaking the code.

    EDIT: Rather than having Image and SideImage, perhaps it's more elegant to use to be able to specify "layout options" and use the Image attribute only.
     
  20. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    You are right, will add support to use guid. But we don't know the guid of an asset without code, may need to write a little tools to retrieve the guid of an asset.
     
  21. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    I just open the .meta file, that is located next to the asset, in a text editor and copy the guid from there. No additional tools needed in that case.
     
  22. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    I see, but I am trying to use this system to make gui for editor window. So, writing it do not waste much time.;)

    upload_2018-2-18_17-40-18.png

    Code (CSharp):
    1. using StackableDecorate;
    2. using UnityEditor;
    3. using UnityEngine;
    4.  
    5. public class WindowTest : EditorWindow
    6. {
    7.     [SideImage(right: 2, top: -4, image = "Prefab Icon", onLeft = true, order = 3)]
    8.     [SideButtons(left: 2, height = 1, titles = "Button1,Button2,Button3", actions = "Action1,Action2,Action3", column = 1, order = 2)]
    9.     [Group("group1", 2)]
    10.     [StackableDrawer]
    11.     public int number1;
    12.     [InGroup("group1"), StackableDrawer]
    13.     public int number2;
    14.     [InGroup("group1"), StackableDrawer]
    15.     public int number3;
    16.  
    17.     [MenuItem("Test/Window Test")]
    18.     public static void Init()
    19.     {
    20.         GetWindow<WindowTest>();
    21.     }
    22.  
    23.     private InlineProperty m_InlineProperty = null;
    24.  
    25.     void OnGUI()
    26.     {
    27.         if (m_InlineProperty == null)
    28.             m_InlineProperty = new InlineProperty(this);
    29.         m_InlineProperty.Draw();
    30.     }
    31. }
     
  23. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    A very rush asset guid getter :D

    2018-02-18 19-23-30.gif

    Code (CSharp):
    1. using StackableDecorate;
    2. using System;
    3. using System.Collections.Generic;
    4. using UnityEditor;
    5. using UnityEngine;
    6.  
    7. public class AssetGUID : EditorWindow
    8. {
    9.     [StackableDrawer]
    10.     public string guid;
    11.  
    12.     [SimpleGrid(cellHeight = 36, columnGetter = "#CalcColumn", maxHeightGetter = "#CalcMaxHeight")]
    13.     public ObjectList m_ObjectList;
    14.  
    15.     private int CalcColumn()
    16.     {
    17.         return (int)(position.width / 36);
    18.     }
    19.  
    20.     private float CalcMaxHeight()
    21.     {
    22.         return position.height - 20;
    23.     }
    24.  
    25.     private void GetGuid(SerializedProperty property)
    26.     {
    27.         if (property.propertyType != SerializedPropertyType.ObjectReference) return;
    28.         if (property.objectReferenceValue == null) return;
    29.         var path = AssetDatabase.GetAssetPath(property.objectReferenceValue);
    30.         var guid = AssetDatabase.AssetPathToGUID(path);
    31.         this.guid = guid;
    32.         Repaint();
    33.     }
    34.  
    35.     [Serializable]
    36.     public class ObjectList
    37.     {
    38.         [OnClick("GetGuid", order = 3)]
    39.         [Box(2, 2, 2, 2, style = "ProjectBrowserTextureIconDropShadow", order = 2)]
    40.         [Image(0, 0, 0, 0, texture = "$", width = 32, height = 32, order = 1)]
    41.         [ShowIf(false)]
    42.         [StackableDrawer]
    43.         public List<UnityEngine.Object> list;
    44.     }
    45.  
    46.     [MenuItem("Tools/Asset GUID")]
    47.     public static void Init()
    48.     {
    49.         GetWindow<AssetGUID>();
    50.     }
    51.  
    52.     private InlineProperty m_InlineProperty = null;
    53.  
    54.     void OnEnable()
    55.     {
    56.         m_ObjectList = new ObjectList();
    57.         m_ObjectList.list = new List<UnityEngine.Object>();
    58.  
    59.         var guids = AssetDatabase.FindAssets("t:Texture");
    60.         foreach (var guid in guids)
    61.         {
    62.             var path = AssetDatabase.GUIDToAssetPath(guid);
    63.             var asset = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(path);
    64.             m_ObjectList.list.Add(asset);
    65.         }
    66.     }
    67.  
    68.     void OnGUI()
    69.     {
    70.         if (m_InlineProperty == null)
    71.             m_InlineProperty = new InlineProperty(this);
    72.         m_InlineProperty.Draw();
    73.     }
    74. }
     
  24. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Tried to recreate the UI of my old little tools, the tools is used to re-pack different color channel of image. The new UI is created with Stackable Decorate:

    new.png

    The original old ugly UI: :oops:
    old.jpg

    The result:
    Test.png
     
    Peter77 likes this.
  25. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Stackable Decorator beta is released in asset store, information is updated in first post.
     
  26. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Added TextField with multi lines and placeholder, if the string is empty, placeholder is displayed.

    2018-03-08 07-34-04.gif
     
    Last edited: Mar 8, 2018
  27. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
  28. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Add DropdownValue allow you to select value from the list.

    dropdownvalue.png

    Code (CSharp):
    1. [DropdownValue("#options", names = "#names")]
    2. public int value;
    3.  
    4. private string[] names = new string[] { "Two", "Four", "Eight", "Sixteen" };
    5. private int[] options = new int[] { 2, 4, 8, 16 };
     
  29. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Added EnumPopup allow to exclude some value, remap name list and display placeholder.

    upload_2018-3-11_18-47-55.png

    upload_2018-3-11_18-48-20.png

    upload_2018-3-11_18-48-41.png

    Code (CSharp):
    1. [EnumPopup(exclude = "Control")]
    2. public EventModifiers key;
    3.  
    4. [EnumPopup(names = "1,2,3,4,5,6,7,8")]
    5. public EventModifiers key2;
    6.  
    7. [EnumPopup(placeHolder = "Please select value.")]
    8. public EventModifiers key3 = (EventModifiers)(-1);
     
    MostHated likes this.
  30. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Added EnumMaskPopup with redesigned popup menu.
    Also allow to exclude some value, remap name list and display placeholder.
    And showCombined and sortCombined to show or sort combined flags.

    2018-03-13 17-49-42.gif

    Code (CSharp):
    1. [EnumMaskPopup(names = "1,2,3,4,5,6,7")]
    2. public EventModifiers key5;
    3.  
    4. [EnumMaskPopup(exclude = "Control", showAll = false)]
    5. public EventModifiers key6;
    6.  
    7. [EnumMaskPopup(placeHolder = "Please select value.")]
    8. public EventModifiers key7;
    9.  
    10. public enum ColorMask { R = 1, G = 2, B = 4, A = 8, RGB = R | G | B, RGBA = RGB | A }
    11. [EnumMaskPopup(showAll = false, showCombined = true)]
    12. public ColorMask mask;
     
    Peter77 likes this.
  31. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Make LayerMaskPopup same as EnumMaskPopup use for layer mask.

    upload_2018-3-14_18-35-58.png
     
  32. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Add DropdownMask same as EnumMaskPopup use with custom names and values.

    upload_2018-3-15_5-25-34.png

    Code (CSharp):
    1. [DropdownMask("#names", "#options", placeHolder = "Please select value.", showAll = false)]
    2. public int mask2;
    3.  
    4. private string[] names = new string[] { "One", "Two", "Four", "Eight", "Sixteen", "12", "18" };
    5. private int[] options = new int[] { 1, 2, 4, 8, 16, 12, 18 };
    6.  
     
  33. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Wow, this is free? Awesome work, can't wait to try it out!
     
  34. Interesting idea. I will play with it over the upcoming weekend.
    QQ: I saw that not everything is in Editor folder which a little bit worries me, how much extra garbage code ends up in the built assembly (if any)?
    Clearly this is an attempt to make Unity Editor custom properties easy. And it's under MIT, which is huge!
    But is any of it's code will end up in the production code?
     
  35. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    All code in attribute is under [ #if UNITY_EDITOR ], only public field is leaved. So all unnecessary code is stripped.
     
    MostHated and Lurking-Ninja like this.
  36. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Add ColorField and CurveField.
    ColorField with parameter showEyedropper, showAlpha and hrd.
    CurveField with parameter color and range.

    upload_2018-3-16_19-15-53.png

    Code (CSharp):
    1. [ColorField(showEyedropper = false)]
    2. public Color color;
    3.  
    4. [CurveField(1, 0, 1, -1, -1, 1, 1)]
    5. public AnimationCurve curve;
     
    MostHated likes this.
  37. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Man, you are really going to town on this asset. : D Keep up the great work.
     
    lokinwai likes this.
  38. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Released 0.2 at Asset Store: Fixed bugs, improved code, and added:
    • TextField - multiline and placeholder
    • DropdownValue - placeholder, custom name and value
    • EnumPopup - placeholder, custom name and exclude name
    • EnumMaskPopup - placeholder, custom name, value and exclude name, with redesigned popup
    • LayerMaskPopup - redesigned popup
    • DropdownMask - placeholder, custom name and value, with redesigned popup
     
  39. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Added ProgressBar.

    upload_2018-3-18_13-14-21.png

    Code (CSharp):
    1. [ProgressBar(100)]
    2. public int progress = 53;
    3.  
    4. [ProgressBar(22, 66, showLabel = false, decimalPlaces = 0)]
    5. public int progress2 = 39;
     
    alexanderameye likes this.
  40. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    That should look pretty nice for the custom scripted build pipeline I am making for myself.
     
  41. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Oh, just see that 39 in range 22-66 is 39% :eek:
    I just choose those number randomly.
     
  42. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I wasn't even paying attention, lol. No worries : D
     
  43. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Added TagPopup and LayerPopup with placeholder and exclude items:

    upload_2018-3-19_17-23-41.png
    upload_2018-3-19_17-24-14.png

    Code (CSharp):
    1. [TagPopup]
    2. public string tag1 = "Untagged";
    3.  
    4. [TagPopup(placeHolder = "Please select a tag.", exclude = "Untagged")]
    5. public string tag2;
    6.  
    7. [LayerPopup]
    8. public int layer1;
    9.  
    10. [LayerPopup(placeHolder = "Please select a layer.", exclude = "Default")]
    11. public int layer2;
     
  44. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Add SortingLayerPopup.and string support to LayerPopup.

    upload_2018-3-20_10-49-39.png

    Code (CSharp):
    1. [LayerPopup]
    2. public string layer3 = "Default";
    3.  
    4. [LayerPopup(placeHolder = "Please select a layer.", exclude = "Default")]
    5. public string layer4;
    6.  
    7. [SortingLayerPopup]
    8. public int sortingLayer1;
    9.  
    10. [SortingLayerPopup(placeHolder = "Please select a layer.", exclude = "Default")]
    11. public string sortingLayer2;
     
    Peter77 likes this.
  45. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Add InputAxisPopup:

    upload_2018-3-20_17-32-4.png

    Code (CSharp):
    1. [InputAxisPopup(placeHolder = "Please select a input.")]
    2. public string input1;
     
  46. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    awesome!
    Looking coll to have this in my editor tools designing.
     
    lokinwai likes this.
  47. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Add AnimatorParameterPopup with filter to parameter type.

    upload_2018-3-21_7-19-22.png

    Code (CSharp):
    1. [AnimatorParameterPopup(placeHolder = "Please select a parameter.")]
    2. public string parameter1;
    3.  
    4. [AnimatorParameterPopup(placeHolder = "Please select a parameter.", triggerType = false)]
    5. public string parameter2;
     
    Peter77 likes this.
  48. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Add input type filtering to InputAxisPopup:

    upload_2018-3-21_12-35-22.png

    Code (CSharp):
    1. [InputAxisPopup(placeHolder = "Please select a input.",
    2.     mouseMovement = false, joystickAxis = false, negativeButton = false)]
    3. public string input2;
     
    Last edited: Mar 21, 2018
    Peter77 likes this.
  49. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Released 0.3 at Asset Store: Fixed bugs, improved code and added:
    • ColorField - showEyedropper, showAlpha and hrd.
    • CurveField - color and range. ProgressBar - min or max, decimalPlaces and showLabel.
    • TagPopup - placeholder and exclude items.
    • LayerPopup - placeholder and exclude items.
    • SortingLayerPopup - placeholder and exclude items.
    • InputAxisPopup - placeholder and exclude items or types.
    • AnimatorParameterPopup - placeholder and exclude items or types.
     
  50. lokinwai

    lokinwai

    Joined:
    Feb 11, 2015
    Posts:
    174
    Add MinValue, MaxValue and ClampValue.

    2018-03-22 19-08-56.gif

    Code (CSharp):
    1. [MinValue(0)]
    2. [StackableField]
    3. public float num1;
    4.  
    5. [MinValue(20)]
    6. [Slider(0, 100)]
    7. public int num2;
    8.  
    9. [MaxValue(20)]
    10. [StackableField]
    11. public float num3;
    12.  
    13. [MaxValue(80)]
    14. [Slider(0, 100)]
    15. public int num4;
    16.  
    17. [ClampValue(20, 80)]
    18. [StackableField]
    19. public float num5;
    20.  
    21. [ClampValue(20, 80)]
    22. [Slider(0, 100)]
    23. public int num6;