Skip to content

Commit 9c2fc2c

Browse files
committed
Update documentation
1 parent 2fbe204 commit 9c2fc2c

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

Assets/Editor Toolbox/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Regular drawers have priority over Toolbox drawers and they cannot be mixed.
8585

8686
#### TagSelectorAttribute
8787

88+
Supported types: **string**.
8889
```csharp
8990
[TagSelector]
9091
public string var1;
@@ -94,8 +95,9 @@ public string var1;
9495

9596
#### ProgressBarAttribute
9697

98+
Supported types: **int**, **float**, **double**.
9799
```csharp
98-
[ProgressBar("Name", minValue: 0.0f, maxValue: 100.0f, HexColor = "#EB7D34")]
100+
[ProgressBar("Name", minValue: 0.0f, maxValue: 100.0f, HexColor = "#EB7D34", IsInteractable = true)]
99101
public float var1 = 80.0f;
100102
```
101103

@@ -104,6 +106,7 @@ public float var1 = 80.0f;
104106

105107
#### MinMaxSliderAttribute
106108

109+
Supported types: **Vector2, Vector2Int**.
107110
```csharp
108111
[MinMaxSlider(0.5f, 71.7f)]
109112
public Vector2 var1;
@@ -113,6 +116,7 @@ public Vector2 var1;
113116

114117
#### AssetPreviewAttribute
115118

119+
Supported types: UnityEngine.**Object**.
116120
```csharp
117121
[AssetPreview]
118122
public GameObject var1;
@@ -124,11 +128,13 @@ public Component var2;
124128

125129
#### SuffixAttribute
126130

131+
Supported types: **all**.
127132
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/suffix.png)
128133

129134

130135
#### EnumTogglesAttribute
131136

137+
Supported types: **Enums**.
132138
```csharp
133139
[System.Flags]
134140
public enum FlagExample
@@ -154,22 +160,27 @@ public FlagExample enumFlag = FlagExample.Flag1 | FlagExample.Flag2 | FlagExampl
154160

155161
#### NotNullAttribute
156162

163+
Supported types: UnityEngine.**Object**.
157164
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/notnull1.png)\
158165
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/notnull2.png)
159166

160167

161168
#### DirectoryAttribute
162169

170+
Supported types: **string**.
163171
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/directory1.png)\
164172
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/directory2.png)
165173

166174
#### SceneNameAttribute
167175

176+
Supported types: **string**.
168177
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scenename1.png)\
169178
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scenename2.png)
170179

171180
#### PresetAttribute
172181

182+
Supported types: **all**.
183+
Remark: can be used only within classes, structs are not supported.
173184
```csharp
174185
private readonly int[] presetValues = new[] { 1, 2, 3, 4, 5 };
175186

@@ -189,6 +200,7 @@ public int presetTarget;
189200

190201
#### SearchableEnumAttribute
191202

203+
Supported types: **Enums**.
192204
```csharp
193205
[SearchableEnum]
194206
public KeyCode enumSearch;
@@ -198,13 +210,15 @@ public KeyCode enumSearch;
198210

199211
#### ClampAttribute
200212

213+
Supported types: **int, float, double**.
201214
```csharp
202215
[Clamp(minValue = 1.5f, maxValue = 11.3f)]
203216
public double var1;
204217
```
205218

206219
#### PasswordAttribute
207220

221+
Supported types: **string**.
208222
```csharp
209223
[Password]
210224
public string password;
@@ -214,16 +228,24 @@ public string password;
214228

215229
#### ChildObjectOnlyAttribute
216230

231+
Supported types: **GameObject, Component**.
232+
217233
#### SceneObjectOnlyAttribute
218234

235+
Supported types: **GameObject, Component**.
236+
219237
#### PrefabObjectOnlyAttribute
220238

239+
Supported types: **GameObject, Component**.
240+
221241
#### LeftToggleAttribute
222242

243+
Supported types: **bool**.
223244
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/lefttoggle.png)
224245

225246
#### FormattedNumberAttribute
226247

248+
Supported types: **int, float, double**.
227249
```csharp
228250
[FormattedNumber]
229251
public int bigNumber;
@@ -233,13 +255,22 @@ public int bigNumber;
233255

234256
#### LabelWidthAttribute
235257

258+
Supported types: **all**.
236259
```csharp
237260
[LabelWidth(220.0f)]
238261
public int veryVeryVeryVeryVeryLongName;
239262
```
240263

241264
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/labelwidth.png)
242265

266+
#### LayerAttribute
267+
268+
Supported types: **int**.
269+
```csharp
270+
[Layer]
271+
public int var1;
272+
```
273+
243274
---
244275

245276
### Toolbox Drawers <a name="toolboxdrawers"></a>

Assets/Editor Toolbox/Runtime/Attributes/Regular/LabelWidthAttribute.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
namespace UnityEngine
55
{
66
/// <summary>
7-
/// Change field label width.
8-
/// <para>Label width</para>
7+
/// Change field's label width.
8+
///
9+
/// <para>Supported types: all.</para>
910
/// </summary>
1011
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
1112
[Conditional("UNITY_EDITOR")]

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Regular drawers have priority over Toolbox drawers and they cannot be mixed.
8585

8686
#### TagSelectorAttribute
8787

88+
Supported types: **string**.
8889
```csharp
8990
[TagSelector]
9091
public string var1;
@@ -94,8 +95,9 @@ public string var1;
9495

9596
#### ProgressBarAttribute
9697

98+
Supported types: **int**, **float**, **double**.
9799
```csharp
98-
[ProgressBar("Name", minValue: 0.0f, maxValue: 100.0f, HexColor = "#EB7D34")]
100+
[ProgressBar("Name", minValue: 0.0f, maxValue: 100.0f, HexColor = "#EB7D34", IsInteractable = true)]
99101
public float var1 = 80.0f;
100102
```
101103

@@ -104,6 +106,7 @@ public float var1 = 80.0f;
104106

105107
#### MinMaxSliderAttribute
106108

109+
Supported types: **Vector2, Vector2Int**.
107110
```csharp
108111
[MinMaxSlider(0.5f, 71.7f)]
109112
public Vector2 var1;
@@ -113,6 +116,7 @@ public Vector2 var1;
113116

114117
#### AssetPreviewAttribute
115118

119+
Supported types: UnityEngine.**Object**.
116120
```csharp
117121
[AssetPreview]
118122
public GameObject var1;
@@ -124,11 +128,13 @@ public Component var2;
124128

125129
#### SuffixAttribute
126130

131+
Supported types: **all**.
127132
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/suffix.png)
128133

129134

130135
#### EnumTogglesAttribute
131136

137+
Supported types: **Enums**.
132138
```csharp
133139
[System.Flags]
134140
public enum FlagExample
@@ -154,22 +160,27 @@ public FlagExample enumFlag = FlagExample.Flag1 | FlagExample.Flag2 | FlagExampl
154160

155161
#### NotNullAttribute
156162

163+
Supported types: UnityEngine.**Object**.
157164
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/notnull1.png)\
158165
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/notnull2.png)
159166

160167

161168
#### DirectoryAttribute
162169

170+
Supported types: **string**.
163171
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/directory1.png)\
164172
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/directory2.png)
165173

166174
#### SceneNameAttribute
167175

176+
Supported types: **string**.
168177
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scenename1.png)\
169178
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scenename2.png)
170179

171180
#### PresetAttribute
172181

182+
Supported types: **all**.
183+
Remark: can be used only within classes, structs are not supported.
173184
```csharp
174185
private readonly int[] presetValues = new[] { 1, 2, 3, 4, 5 };
175186

@@ -189,6 +200,7 @@ public int presetTarget;
189200

190201
#### SearchableEnumAttribute
191202

203+
Supported types: **Enums**.
192204
```csharp
193205
[SearchableEnum]
194206
public KeyCode enumSearch;
@@ -198,13 +210,15 @@ public KeyCode enumSearch;
198210

199211
#### ClampAttribute
200212

213+
Supported types: **int, float, double**.
201214
```csharp
202215
[Clamp(minValue = 1.5f, maxValue = 11.3f)]
203216
public double var1;
204217
```
205218

206219
#### PasswordAttribute
207220

221+
Supported types: **string**.
208222
```csharp
209223
[Password]
210224
public string password;
@@ -214,16 +228,24 @@ public string password;
214228

215229
#### ChildObjectOnlyAttribute
216230

231+
Supported types: **GameObject, Component**.
232+
217233
#### SceneObjectOnlyAttribute
218234

235+
Supported types: **GameObject, Component**.
236+
219237
#### PrefabObjectOnlyAttribute
220238

239+
Supported types: **GameObject, Component**.
240+
221241
#### LeftToggleAttribute
222242

243+
Supported types: **bool**.
223244
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/lefttoggle.png)
224245

225246
#### FormattedNumberAttribute
226247

248+
Supported types: **int, float, double**.
227249
```csharp
228250
[FormattedNumber]
229251
public int bigNumber;
@@ -233,13 +255,22 @@ public int bigNumber;
233255

234256
#### LabelWidthAttribute
235257

258+
Supported types: **all**.
236259
```csharp
237260
[LabelWidth(220.0f)]
238261
public int veryVeryVeryVeryVeryLongName;
239262
```
240263

241264
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/labelwidth.png)
242265

266+
#### LayerAttribute
267+
268+
Supported types: **int**.
269+
```csharp
270+
[Layer]
271+
public int var1;
272+
```
273+
243274
---
244275

245276
### Toolbox Drawers <a name="toolboxdrawers"></a>

0 commit comments

Comments
 (0)