44[ AddComponentMenu ( "Editor Toolbox/Cheat Sheet 1 (Regular)" ) ]
55public class SampleBehaviour1 : MonoBehaviour
66{
7- [ Label ( "TagSelector " , skinStyle : SkinStyle . Box ) ]
7+ [ Label ( "Tag Selector " , skinStyle : SkinStyle . Box ) ]
88
99 [ TagSelector ]
1010 public string targetTag ;
1111
12- [ Label ( "ProgressBar " , skinStyle : SkinStyle . Box ) ]
12+ [ Label ( "Progress Bar " , skinStyle : SkinStyle . Box ) ]
1313
1414 [ ProgressBar ( minValue : - 10.0f , maxValue : 50.0f , HexColor = "#234DEA" ) ]
1515 public float progressBar = 25.4f ;
1616
17- [ Label ( "MinMaxSlider " , skinStyle : SkinStyle . Box ) ]
17+ [ Label ( "MinMax Slider " , skinStyle : SkinStyle . Box ) ]
1818
1919 [ MinMaxSlider ( 10.0f , 100.0f ) ]
2020 public Vector2 var2 ;
2121
22- [ Label ( "AssetPreview " , skinStyle : SkinStyle . Box ) ]
22+ [ Label ( "Asset Preview " , skinStyle : SkinStyle . Box ) ]
2323
2424 [ AssetPreview ]
2525 public GameObject var8 ;
26- [ AssetPreview ( useLabel : false ) , Help ( "Who needs label?" ) ]
27- public GameObject var9 ;
2826 [ AssetPreview ]
2927 public Transform preview ;
3028
@@ -33,12 +31,12 @@ public class SampleBehaviour1 : MonoBehaviour
3331 [ Suffix ( "kg" ) ]
3432 public float var10 ;
3533
36- [ Label ( "LeftToggle " , skinStyle : SkinStyle . Box ) ]
34+ [ Label ( "Left Toggle " , skinStyle : SkinStyle . Box ) ]
3735
3836 [ LeftToggle ]
3937 public bool var12 ;
4038
41- [ Label ( "EnumToggles " , skinStyle : SkinStyle . Box ) ]
39+ [ Label ( "Enum Toggles " , skinStyle : SkinStyle . Box ) ]
4240
4341 [ EnumToggles ]
4442 public FlagExample enumFlag = FlagExample . Flag1 | FlagExample . Flag2 ;
@@ -64,7 +62,7 @@ public enum FlagExample
6462 [ Directory ]
6563 public string directory ;
6664
67- [ Label ( "SceneName " , skinStyle : SkinStyle . Box ) ]
65+ [ Label ( "Scene Name " , skinStyle : SkinStyle . Box ) ]
6866
6967 [ SceneName ]
7068 public string sceneName ;
@@ -76,7 +74,7 @@ public enum FlagExample
7674
7775 private readonly int [ ] presetValues = new [ ] { 1 , 2 , 3 , 4 , 5 } ;
7876
79- [ Label ( "SearchableEnum " , skinStyle : SkinStyle . Box ) ]
77+ [ Label ( "Searchable Enum " , skinStyle : SkinStyle . Box ) ]
8078
8179 [ SearchableEnum ]
8280 public KeyCode enumSearch ;
@@ -88,6 +86,9 @@ public enum FlagExample
8886
8987 [ Label ( "Validation" , skinStyle : SkinStyle . Box ) ]
9088
89+ [ Help ( "NotNullAttribute, ClampAttribute, SceneObjectOnlyAttribute, ChildObjectOnlyAttribute, PrefabObjectOnlyAttribute " +
90+ "are part of group that will be re-implemented in future as ToolboxValidationAttributes. " +
91+ "Unfortunately, for now, you can't use them together with any other PropertyDrawer." , UnityMessageType . Warning ) ]
9192 [ NotNull ]
9293 public Transform var13 ;
9394
@@ -101,7 +102,7 @@ public enum FlagExample
101102 [ PrefabObjectOnly ]
102103 public GameObject prefabReference ;
103104
104- [ Label ( "LabelByChild " , skinStyle : SkinStyle . Box ) ]
105+ [ Label ( "Label By Child " , skinStyle : SkinStyle . Box ) ]
105106
106107 [ LabelByChild ( "var3.var2" ) ]
107108 public SampleClass1 sampleField ;
@@ -123,15 +124,10 @@ public class SampleClass2
123124 public string var2 ;
124125 }
125126
126- [ Label ( "FormattedNumber " , skinStyle : SkinStyle . Box ) ]
127+ [ Label ( "Formatted Number " , skinStyle : SkinStyle . Box ) ]
127128
128129 [ FormattedNumber ]
129130 public int bigNumber ;
130131 [ FormattedNumber ( "c" ) ]
131132 public float currency ;
132-
133- private void OnValidate ( )
134- {
135- var9 = var8 ;
136- }
137133}
0 commit comments