Skip to content

Commit d7afe76

Browse files
committed
Update: README.md & samples
1 parent a071103 commit d7afe76

File tree

4 files changed

+49
-42
lines changed

4 files changed

+49
-42
lines changed

Assets/Examples/Scenes/SampleScene.unity

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -675,17 +675,11 @@ MonoBehaviour:
675675
- b
676676
- c
677677
ints: 01000000080000000c00000010000000
678-
var21: {fileID: 977748988}
679-
var22: {fileID: 2100000, guid: 7404c70251f9d0045a4aabaa49d83963, type: 2}
680-
var23: {fileID: 2800000, guid: 45980f2b5045fab4a95e80d4cd1d91a8, type: 3}
681-
var24: {fileID: 8300000, guid: e83fc6426e5f2e0448cc3e51102509aa, type: 3}
682-
var25: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
683-
var27:
684-
i: 2
685-
strings:
686-
- MainCamera
687-
- Untagged
688-
- Respawn
678+
component: {fileID: 2037155953}
679+
material: {fileID: 2100000, guid: 7404c70251f9d0045a4aabaa49d83963, type: 2}
680+
texture: {fileID: 2800000, guid: d7cf546aa64aceb488a523b6662319b6, type: 3}
681+
audioClip: {fileID: 8300000, guid: e83fc6426e5f2e0448cc3e51102509aa, type: 3}
682+
mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
689683
largeArray:
690684
- {fileID: 0}
691685
- {fileID: 0}
@@ -706,11 +700,18 @@ MonoBehaviour:
706700
- {fileID: 0}
707701
- {fileID: 0}
708702
- {fileID: 0}
709-
q: {x: 0, y: 0, z: 0, w: 0}
710-
a1: -1
711-
b1: 5.5
712-
var40: 1.33
713-
var41: {x: 0, y: 1.9792935}
703+
quaternion: {x: 0, y: 0, z: 0, w: 0}
704+
q2: {x: 0, y: 0, z: 0, w: 0}
705+
min: -1
706+
max: 5.5
707+
dynamicRange: 1.5
708+
dynamicMinMax: {x: 0, y: 3}
709+
nestedObject:
710+
i: 1
711+
strings:
712+
- EditorOnly
713+
- Player
714+
- Untagged
714715
--- !u!4 &661896459
715716
Transform:
716717
m_ObjectHideFlags: 2

Assets/Examples/Scripts/SampleBehaviour2.cs

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,44 @@ public int GetValue()
2727
[Label("InLine Editor", skinStyle: SkinStyle.Box)]
2828

2929
[InLineEditor(DisableEditor = false)]
30-
public Transform var21;
30+
public Component component;
3131

3232
[InLineEditor(drawSettings: true)]
33-
public Material var22;
33+
public Material material;
3434

3535
[InLineEditor(true, true)]
36-
public Texture var23;
36+
public Texture texture;
3737

3838
[InLineEditor(drawSettings: true)]
39-
public AudioClip var24;
39+
public AudioClip audioClip;
4040

4141
[InLineEditor(HideScript = true)]
42-
public Mesh var25;
42+
public Mesh mesh;
4343

44-
[Label("Nested Properties", skinStyle: SkinStyle.Box)]
44+
[Label("Scrollable Items", skinStyle: SkinStyle.Box)]
45+
46+
[ScrollableItems(defaultMinIndex: 0, defaultMaxIndex: 5)]
47+
public GameObject[] largeArray = new GameObject[19];
48+
49+
[Label("Ignore Parent", skinStyle: SkinStyle.Box)]
50+
51+
public Quaternion quaternion;
52+
[IgnoreParent]
53+
public Quaternion q2;
54+
55+
[Label("Dynamic Range & MinMax Slider", skinStyle: SkinStyle.Box)]
56+
57+
public float min = -1;
58+
public float max = 5.5f;
59+
[DynamicRange(nameof(min), nameof(max))]
60+
public float dynamicRange;
61+
[DynamicMinMaxSlider(nameof(min), nameof(max))]
62+
public Vector2 dynamicMinMax;
63+
64+
[Label("Nested Objects", skinStyle: SkinStyle.Box)]
4565

4666
[Help("You can use Toolbox Properties inside serializable types without limitations.")]
47-
public SampleNestedClass var27;
67+
public SampleNestedClass nestedObject;
4868

4969
[System.Serializable]
5070
public class SampleNestedClass
@@ -55,23 +75,4 @@ public class SampleNestedClass
5575
[Help("Nested Information.", ApplyCondition = true)]
5676
public string[] strings;
5777
}
58-
59-
[Label("Scrollable Items", skinStyle: SkinStyle.Box)]
60-
61-
[ScrollableItems(defaultMinIndex: 0, defaultMaxIndex: 5)]
62-
public GameObject[] largeArray = new GameObject[19];
63-
64-
[Label("Ignore Parent", skinStyle: SkinStyle.Box)]
65-
66-
[IgnoreParent]
67-
public Quaternion q;
68-
69-
[Label("Dynamic Range & MinMax Slider", skinStyle: SkinStyle.Box)]
70-
71-
public float a1 = -1;
72-
public float b1 = 5.5f;
73-
[DynamicRange(nameof(a1), nameof(b1))]
74-
public float var40;
75-
[DynamicMinMaxSlider(nameof(a1), nameof(b1))]
76-
public Vector2 var41;
7778
}

Docs/ignoreparent.png

4.23 KB
Loading

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,11 +550,16 @@ public GameObject[] largeArray = new GameObject[19];
550550

551551
##### Other ToolboxProperty attributes
552552

553+
**IgnoreParent** allows you to hide the parent's label, foldout arrow and remove the standard indentation for nested fields.
554+
553555
```csharp
556+
public Quaternion quaternion;
554557
[IgnoreParent]
555558
public Quaternion q;
556559
```
557560

561+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/ignoreparent.png)
562+
558563
```csharp
559564
[DynamicMinMaxSlider(nameof(minValue), nameof(MaxValue))]
560565
public Vector2 vec2;

0 commit comments

Comments
 (0)