Skip to content

Commit e81100e

Browse files
committed
Update samples; update README.md
1 parent d473b98 commit e81100e

File tree

5 files changed

+95
-16
lines changed

5 files changed

+95
-16
lines changed

Assets/Editor Toolbox/Editor/ToolboxEditorSettings.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
43
using UnityEngine;
54
using UnityEngine.Serialization;
65

@@ -62,9 +61,9 @@ internal interface IToolboxSceneViewSettings
6261
[CreateAssetMenu(fileName = "Editor Toolbox Settings", menuName = "Editor Toolbox/Settings")]
6362
internal class ToolboxEditorSettings : ScriptableObject, IToolboxGeneralSettings, IToolboxHierarchySettings, IToolboxProjectSettings, IToolboxInspectorSettings, IToolboxSceneViewSettings
6463
{
65-
[SerializeField]
64+
[SerializeField, Tooltip("Set to false if you don't want to use Toolbox Hierarchy and related features.")]
6665
private bool useToolboxHierarchy = true;
67-
[SerializeField]
66+
[SerializeField, Tooltip("Set to true if you want to display horizontal lines in the Hierarchy Window.")]
6867
private bool drawHorizontalLines = true;
6968
[SerializeField]
7069
private bool showSelectionsCount;
@@ -73,7 +72,7 @@ internal class ToolboxEditorSettings : ScriptableObject, IToolboxGeneralSettings
7372
[FormerlySerializedAs("rowDataItems")]
7473
private List<HierarchyItemDataType> rowDataTypes = Defaults.rowDataTypes;
7574

76-
[SerializeField]
75+
[SerializeField, Tooltip("Set to false if you don't want to use Toolbox Folders and related features.")]
7776
private bool useToolboxFolders = true;
7877

7978
[SerializeField, Clamp(0.0f, float.MaxValue)]
@@ -95,7 +94,7 @@ internal class ToolboxEditorSettings : ScriptableObject, IToolboxGeneralSettings
9594
[SerializeField]
9695
private KeyCode selectorKey = KeyCode.Tab;
9796

98-
[SerializeField, Tooltip("Set to false if you don't want to use Toolbox attributes and related features.")]
97+
[SerializeField, Tooltip("Set to false if you don't want to use Toolbox Attributes and related features.")]
9998
private bool useToolboxDrawers = true;
10099
[SerializeField, Tooltip("By default, Inspectors will use the built-in version of the list instead of the Toolbox-based one. " +
101100
"Keep in mind that built-in properties don't support Toolbox attributes. \n\n Changing this property will recompile the code.")]
@@ -471,7 +470,7 @@ private static class Defaults
471470
internal const float smallFolderIconXPaddingDefault = 0.15f;
472471
internal const float smallFolderIconYPaddingDefault = 0.15f;
473472

474-
internal readonly static List<HierarchyItemDataType> rowDataTypes = new List<HierarchyItemDataType>()
473+
internal static readonly List<HierarchyItemDataType> rowDataTypes = new List<HierarchyItemDataType>()
475474
{
476475
HierarchyItemDataType.Icon,
477476
HierarchyItemDataType.Toggle,

Assets/Editor Toolbox/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,13 +604,29 @@ public GameObject[] largeArray = new GameObject[19];
604604

605605
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scrollableitems.png)
606606

607-
##### Other ToolboxProperty attributes
607+
##### IgnoreParentAttribute
608+
609+
**IgnoreParent** allows you to hide the parent's label, foldout arrow and remove the standard indentation for nested fields.
608610

609611
```csharp
610612
[IgnoreParent]
611613
public Quaternion q;
612614
```
613615

616+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/ignoreparent.png)
617+
618+
##### DynamicRangeAttribute
619+
620+
```csharp
621+
[DynamicRange(nameof(minValue), nameof(MaxValue))]
622+
public float var1;
623+
624+
public float minValue;
625+
public float MaxValue => 15.0f;
626+
```
627+
628+
##### DynamicMinMaxSliderAttribute
629+
614630
```csharp
615631
[DynamicMinMaxSlider(nameof(minValue), nameof(MaxValue))]
616632
public Vector2 vec2;
@@ -952,7 +968,7 @@ public void Usage()
952968
953969
#### SerializedDirectory
954970

955-
Allows to serialize folders in form of assets and retrieve direct paths in runtime.
971+
Allows to serialize folders in form of assets and retrieve direct paths in Runtime.
956972

957973
```csharp
958974
public SerializedDirectory serializeDirectory;

Assets/Examples/Scenes/SampleScene.unity

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,54 @@ MonoBehaviour:
13011301
bigNumber: 12345678
13021302
currency: 20.41
13031303
layer: 5
1304+
animationCurve1:
1305+
serializedVersion: 2
1306+
m_Curve:
1307+
- serializedVersion: 3
1308+
time: 0
1309+
value: 1
1310+
inSlope: 0
1311+
outSlope: 0
1312+
tangentMode: 34
1313+
weightedMode: 0
1314+
inWeight: 0
1315+
outWeight: 0
1316+
- serializedVersion: 3
1317+
time: 1
1318+
value: 1
1319+
inSlope: 0
1320+
outSlope: 0
1321+
tangentMode: 34
1322+
weightedMode: 0
1323+
inWeight: 0
1324+
outWeight: 0
1325+
m_PreInfinity: 2
1326+
m_PostInfinity: 2
1327+
m_RotationOrder: 4
1328+
animationCurve2:
1329+
serializedVersion: 2
1330+
m_Curve:
1331+
- serializedVersion: 3
1332+
time: -1
1333+
value: -1
1334+
inSlope: 2
1335+
outSlope: 2
1336+
tangentMode: 0
1337+
weightedMode: 0
1338+
inWeight: 0
1339+
outWeight: 0
1340+
- serializedVersion: 3
1341+
time: 2
1342+
value: 2
1343+
inSlope: 0
1344+
outSlope: 0
1345+
tangentMode: 0
1346+
weightedMode: 0
1347+
inWeight: 0
1348+
outWeight: 0
1349+
m_PreInfinity: 2
1350+
m_PostInfinity: 2
1351+
m_RotationOrder: 4
13041352
clampedValue: 6
13051353
notNullReference: {fileID: 0}
13061354
childReference: {fileID: 0}

Assets/Examples/Scripts/SampleBehaviour1.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,19 @@ public enum FlagExample
101101
[Layer]
102102
public int layer;
103103

104-
[BeginGroup(Order = -2)]
105-
106-
[Help("NotNullAttribute, ClampAttribute, SceneObjectOnlyAttribute, ChildObjectOnlyAttribute, PrefabObjectOnlyAttribute " +
107-
"are part of group that will be re-implemented in future as ToolboxValidationAttributes. " +
108-
"Unfortunately, for now, you can't use them together with any other PropertyDrawer.", UnityMessageType.Warning, Order = -1)]
109-
110104
[Label("Animation Curve Settings", skinStyle: SkinStyle.Box)]
111105

112106
[AnimationCurveSettings]
113107
public AnimationCurve animationCurve1;
114108
[AnimationCurveSettings(-1.0f, -1.0f, 2.0f, 2.0f, HexColor = "#360E45")]
115109
public AnimationCurve animationCurve2;
116110

111+
[BeginGroup(Order = -2)]
112+
113+
[Help("NotNullAttribute, ClampAttribute, SceneObjectOnlyAttribute, ChildObjectOnlyAttribute, PrefabObjectOnlyAttribute " +
114+
"are part of group that will be re-implemented in future as ToolboxValidationAttributes. " +
115+
"Unfortunately, for now, you can't use them together with any other PropertyDrawer.", UnityMessageType.Warning, Order = -1)]
116+
117117
[Label("Validation", skinStyle: SkinStyle.Box)]
118118

119119
[Clamp(0.0f, 11.2f)]

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,13 +604,29 @@ public GameObject[] largeArray = new GameObject[19];
604604

605605
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scrollableitems.png)
606606

607-
##### Other ToolboxProperty attributes
607+
##### IgnoreParentAttribute
608+
609+
**IgnoreParent** allows you to hide the parent's label, foldout arrow and remove the standard indentation for nested fields.
608610

609611
```csharp
610612
[IgnoreParent]
611613
public Quaternion q;
612614
```
613615

616+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/ignoreparent.png)
617+
618+
##### DynamicRangeAttribute
619+
620+
```csharp
621+
[DynamicRange(nameof(minValue), nameof(MaxValue))]
622+
public float var1;
623+
624+
public float minValue;
625+
public float MaxValue => 15.0f;
626+
```
627+
628+
##### DynamicMinMaxSliderAttribute
629+
614630
```csharp
615631
[DynamicMinMaxSlider(nameof(minValue), nameof(MaxValue))]
616632
public Vector2 vec2;
@@ -952,7 +968,7 @@ public void Usage()
952968
953969
#### SerializedDirectory
954970

955-
Allows to serialize folders in form of assets and retrieve direct paths in runtime.
971+
Allows to serialize folders in form of assets and retrieve direct paths in Runtime.
956972

957973
```csharp
958974
public SerializedDirectory serializeDirectory;

0 commit comments

Comments
 (0)