Skip to content

Commit e2c6d98

Browse files
committed
Update: README.md, CHANGELOG.md & samples
1 parent eab215d commit e2c6d98

8 files changed

Lines changed: 140 additions & 53 deletions

File tree

Assets/Editor Toolbox/CHANGELOG.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
1+
## 0.13.0 [28.08.2024]
2+
3+
### Added:
4+
- Warning information if currently serialized type in TypeField-based drawers (SerializedType, [ReferencerPicker]) is not available in the filtered types collection
5+
- Context menu operations for [SerializeReference] properties (Copy, Paste, Duplicate), all operations are based on a deep copy of the source reference
6+
- Basic support for generic references while using [SerializeReference] & [ReferencePicker], can be utilized in Unity 2023+
7+
- More unit tests (PropertyUtility, filtering generic types)
8+
9+
### Changed:
10+
- Fix duplicated initialization process forced by the OnValidate call
11+
- Hierarchy: For now 'Script' label displays maximum 5 scripts
12+
- Improved types label generation for TypeField-based drawers (SerializedType, [ReferencerPicker])
13+
114
## 0.12.13 [22.08.2024]
215

16+
### Added:
17+
- DisableInEditModeAttribute
18+
319
### Changed:
420
- Hierarchy: Added Tree List renderer, which improves visual identification of parent and child gameobjects
521
- Hierarchy: For now 'Script' label will display all available components linked to a GameObject/Prefabs
622
- Hierarchy: For now 'Layer' label will display full layer name instead of the layer mask value
723
- Fix SceneView settings change events firing when they shouldn't
824
- Fix issue when trying to find private fields/properties from parent classes (e.g. while using conditional attributes)
925

10-
### Added:
11-
- DisableInEditModeAttribute
12-
1326
## 0.12.12 [17.06.2024]
1427

28+
### Added:
29+
- NotPrefabObjectOnlyAttribute
30+
1531
### Changed:
1632
- LabelWidthAttribute is now part of the Toolbox decorator attributes (can be mixed with other attributes)
1733
- Hierarchy: Script, Tag, and Layer columns are now excluded from the default settings
1834
- Possibility to change style for groups ([BeginGroup] and [BeginHorizontalGroup] attributes)
1935
- ScriptableObject Creation Wizard now accepts only ScriptableObjects marked with the [CreateInWizard] or [CreateAssetMenu] attributes
2036

21-
### Added:
22-
- NotPrefabObjectOnlyAttribute
23-
2437
## 0.12.11 [05.04.2024]
2538

2639
### Changed:
@@ -53,13 +66,13 @@
5366

5467
## 0.12.7 [10.12.2023]
5568

69+
### Added:
70+
- 'Revert Prefab Name' option for prefabs in the GameObject/Prefabs context menu
71+
5672
### Changed:
5773
- Possibility to interact with ProgressBarDrawer (added IsInteractable property to the ProgressBarAttribute)
5874
- MinMaxAttribute now supports Vector2Int
5975

60-
### Added:
61-
- 'Revert Prefab Name' option for prefabs in the GameObject/Prefabs context menu
62-
6376
## 0.12.6 [19.10.2023]
6477

6578
### Changed:
@@ -68,12 +81,12 @@
6881

6982
## 0.12.5 [11.09.2023]
7083

71-
### Changed:
72-
- Make ToolboxEditorHandler public
73-
7484
### Added:
7585
- Add public OnCacheRefreshed event to the SceneSerializationUtility
7686

87+
### Changed:
88+
- Make ToolboxEditorHandler public
89+
7790
## 0.12.4 [31.07.2023]
7891

7992
### Changed:
@@ -85,16 +98,16 @@
8598

8699
## 0.12.3 [17.06.2023]
87100

101+
### Added:
102+
- SceneView extension: better way to select raycasted objects in the Scene view
103+
- LabelWidthAttribute
104+
88105
### Changed:
89106
- Fix updating SerializedScene index after deleting Scene
90107
- Fix SerializedScene index calculation
91108
- Fix NRE when deleted Scene was still included in Build Settings
92109
- Fix compilation errors in Unity 2018.x
93110

94-
### Added:
95-
- SceneView extension: better way to select raycasted objects in the Scene view
96-
- LabelWidthAttribute
97-
98111
## 0.12.1 [12.04.2023]
99112

100113
### Changed:

Assets/Editor Toolbox/README.md

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ Unity 2018.x or newer
5656
- [Hierarchy](#hierarchy)
5757
- [Project](#project)
5858
- [Toolbar](#toolbar)
59-
- [Utilities](#utilities)
6059
- [SceneView](#sceneview)
60+
- [Utilities](#utilities)
6161

6262
## Settings
6363

@@ -655,22 +655,22 @@ To prevent issues after renaming types use `UnityEngine.Scripting.APIUpdating.Mo
655655

656656
```csharp
657657
[SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.ByFlatName)]
658-
public Interface1 var1;
658+
public ISampleInterface var1;
659659
[SerializeReference, ReferencePicker(ForceUninitializedInstance = true)]
660-
public Interface1 var1;
660+
public ISampleInterface var1;
661661
[SerializeReference, ReferencePicker(ParentType = typeof(ClassWithInterface2)]
662662
public ClassWithInterfaceBase var2;
663663

664-
public interface Interface1 { }
664+
public interface ISampleInterface { }
665665

666666
[Serializable]
667-
public struct Struct : Interface1
667+
public struct Struct : ISampleInterface
668668
{
669669
public bool var1;
670670
public bool var2;
671671
}
672672

673-
public abstract class ClassWithInterfaceBase : Interface1 { }
673+
public abstract class ClassWithInterfaceBase : ISampleInterface { }
674674

675675
[Serializable]
676676
public class ClassWithInterface1 : ClassWithInterfaceBase
@@ -694,6 +694,47 @@ public class ClassWithInterface3 : ClassWithInterfaceBase
694694

695695
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/referencepicker.png)
696696
697+
##### SerializeReference generics support
698+
699+
Unity 2023.x introduced support for serializing generic references.
700+
In this case you can serialize generic types or use generics as a base class for your references.
701+
**ReferencePicker** will automatically create all available generic types if the generic definition satisfies the constraints.
702+
703+
```csharp
704+
#if UNITY_2023_2_OR_NEWER
705+
[SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.None)]
706+
public IGenericInterface<string> genericString;
707+
[SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.None)]
708+
public IGenericInterface<int> genericInt;
709+
[SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.None)]
710+
public IGenericInterface<bool> genericBool;
711+
712+
public interface IGenericInterface<TValue>
713+
{
714+
TValue Value { get; }
715+
}
716+
717+
public class GenericInterfaceImplementation<TValue> : IGenericInterface<TValue>
718+
{
719+
[SerializeField]
720+
private TValue value;
721+
722+
public TValue Value => value;
723+
}
724+
#endif
725+
```
726+
727+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializereferencegenerics.png)
728+
729+
##### SerializeReference context menu operations
730+
731+
You can use few custom context menu operations for the SerializeReference-based fields:
732+
- **Copy Serialize Reference**: creates a deep copy of the linked reference
733+
- **Paste Serialize Reference**: allows to paste preserved copy to a field
734+
- **Duplicate Serialize Reference**: allows to duplicate the linked reference (works only on collection elements)
735+
736+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializereferenceoperations.png)
737+
697738
#### Custom Editors <a name="toolboxeditors"></a>
698739

699740
If you want to create a custom **UnityEditor.Editor** for your components and still use Toolbox-related features be sure to inherit from the **Toolbox.Editor.ToolboxEditor** class.
@@ -727,9 +768,9 @@ public class SampleEditor : ToolboxEditor
727768
}
728769
```
729770

730-
##### Custom Editor Implementation
731-
- **Toolbox.Editor.ToolboxEditor** - default class, override it if you want to implement a custom Editor for your components and ScriptableObjects
732-
- **Toolbox.Editor.ToolboxScriptedImporterEditor** - override it if you want to implement a custom Editor for your custom importers
771+
##### Custom Editor Implementations
772+
- **Toolbox.Editor.ToolboxEditor**: default class, override it if you want to implement a custom Editor for your components and ScriptableObjects
773+
- **Toolbox.Editor.ToolboxScriptedImporterEditor**: override it if you want to implement a custom Editor for your custom importers
733774

734775
### Material Drawers <a name="materialdrawers"></a>
735776

@@ -832,10 +873,14 @@ public void Usage()
832873

833874
Allows to serialize DateTime.
834875

876+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializeddate.png)
877+
835878
#### SerializedDirectory
836879

837880
Allows to serialize folders in form of assets and retrieve direct paths in runtime.
838881

882+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializeddirectory.png)
883+
839884
## Editor Extensions
840885

841886
### Hierarchy <a name="hierarchy"></a>
@@ -916,23 +961,29 @@ public static class MyEditorUtility
916961

917962
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/toolbar.png)
918963
964+
### SceneView <a name="sceneview"></a>
965+
966+
Select a specific object that is under the cursor (default key: tab).
967+
968+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/sceneview.png)
969+
919970
### Utilities <a name="utilities"></a>
920971

972+
In this section you will find various extensions that don't fit into a specific category.
973+
974+
#### Context Menu operations
975+
921976
Copy and paste all components from/to particular GameObject.
922977

923978
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/utils.png)
924979
980+
#### ScriptableObject Creation Wizard
981+
925982
Create multiple ScriptableObjects at once.
926983
Wizard will allow only ScritpableObjects marked with **[Toolbox.Attributes.CreateInWizard]** or **[UnityEngine.CreateAssetMenu]** attributes.
927984

928985
```
929986
Assets/Create/Editor Toolbox/ScriptableObject Creation Wizard
930987
```
931988

932-
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/createso.png)
933-
934-
### SceneView <a name="sceneview"></a>
935-
936-
Select a specific object that is under the cursor (default key: tab).
937-
938-
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/sceneview.png)
989+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/createso.png)

Assets/Editor Toolbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.browar.editor-toolbox",
33
"displayName": "Editor Toolbox",
4-
"version": "0.12.13",
4+
"version": "0.13.0",
55
"unity": "2018.1",
66
"description": "Tools, custom attributes, drawers, hierarchy overlay, and other extensions for the Unity Editor.",
77
"keywords": [

Assets/Examples/Scenes/SampleScene.unity

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,9 @@ MonoBehaviour:
18191819
error: 0
18201820
date:
18211821
ticks: 637820719200000000
1822+
directory:
1823+
directoryAsset: {fileID: 102900000, guid: 6c5a542f2ff6e87499c1a85957eafd9e, type: 3}
1824+
path: Assets/Editor Toolbox
18221825
--- !u!1 &1221313406
18231826
GameObject:
18241827
m_ObjectHideFlags: 0

Assets/Examples/Scripts/SampleBehaviour5.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class SampleBehaviour5 : MonoBehaviour
1717
public SerializedType type4;
1818
[TypeConstraint(typeof(Collider), AllowAbstract = true, AllowObsolete = false, TypeSettings = TypeSettings.Class, TypeGrouping = TypeGrouping.ByFlatName)]
1919
public SerializedType type5;
20-
[TypeConstraint(typeof(ISampleGenericInterface<int>), AllowAbstract = false, AllowObsolete = false, TypeSettings = TypeSettings.Class, TypeGrouping = TypeGrouping.ByFlatName)]
20+
[TypeConstraint(typeof(ISampleGenericInterface<>), AllowAbstract = false, AllowObsolete = false, TypeSettings = TypeSettings.Class, TypeGrouping = TypeGrouping.ByFlatName)]
2121
public SerializedType type6;
2222

2323
public interface ISampleGenericInterface<T> { }
@@ -41,4 +41,8 @@ public class ClassWithInterface3<T> : ISampleGenericInterface<bool> { }
4141
[Label("Serialized DateTime", skinStyle: SkinStyle.Box)]
4242

4343
public SerializedDateTime date;
44+
45+
[Label("Serialized Directory", skinStyle: SkinStyle.Box)]
46+
47+
public SerializedDirectory directory;
4448
}

Docs/serializeddate.png

1.7 KB
Loading

Docs/serializedirectory.png

5.59 KB
Loading

0 commit comments

Comments
 (0)