Skip to content

Commit 980fc04

Browse files
committed
Update: README.md
1 parent 6fb2c93 commit 980fc04

File tree

5 files changed

+41
-10
lines changed

5 files changed

+41
-10
lines changed

Assets/Editor Toolbox/Editor/Utilities/PropertyUtility.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ internal static bool IsSerializableArrayElement(string indexField, out int index
644644

645645
internal static bool IsSerializeReferenceProperty(SerializedProperty property)
646646
{
647+
#if UNITY_2019_3_OR_NEWER
647648
if (property == null)
648649
{
649650
return false;
@@ -663,6 +664,8 @@ internal static bool IsSerializeReferenceProperty(SerializedProperty property)
663664
return elementType.Contains(managedReferenceType);
664665
}
665666

667+
return false;
668+
#endif
666669
return false;
667670
}
668671

Assets/Editor Toolbox/README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ Unity 2018.x or newer
5656
- [Toolbox Custom Editors](#toolboxeditors)
5757
- [Material Drawers](#materialdrawers)
5858
- [Serialized Types](#serialized-types)
59+
- [SerializedType](#serializedtype)
60+
- [SerializedScene](#serializedscene)
61+
- [SerializedDictionary](#serializeddictionary)
62+
- [SerializedDateTime](#serializeddatetime)
63+
- [SerializedDirectory](#serializeddictionary)
5964
- [Editor Extensions](#editor-extensions)
6065
- [Hierarchy](#hierarchy)
6166
- [Project](#project)
@@ -777,6 +782,14 @@ public class ClassWithInterface3 : ClassWithInterfaceBase
777782

778783
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/referencepicker.png)
779784
785+
##### ReferencePicker properties
786+
787+
- **ParentType**: Indicates what *System.Type* should be used as 'base' to create a collection of all available inherited types.
788+
- **ForceUninitializedInstance** (false): If *true* - a new reference instance will be created without the standard construction flow and object will be uninitialized (constructor won't be called).
789+
- **TypeGrouping** (TypeGrouping.None): Indicates how the available types are displayed.
790+
- **AddTextSearchField** (true): If *true* - the popup picker will be extended with a text search field. It may be useful for larger type collections.
791+
- **AddConfimartionBox** (false): If *true* - creates an additional confirmation box to make sure that the new assignment is intended.
792+
780793
##### SerializeReference generics support
781794

782795
Unity 2023.x introduced support for serializing generic references.
@@ -885,7 +898,7 @@ _HideIfExample ("Range", Range(0, 1)) = 0.75
885898
886899
## Serialized Types
887900

888-
#### SerializedType
901+
#### SerializedType <a name="serializedtype"></a>
889902

890903
Allows to serialize Types and pick them through a dedicated picker.
891904

@@ -901,7 +914,7 @@ public void Usage()
901914

902915
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializedtype.png)
903916
904-
#### SerializedScene
917+
#### SerializedScene <a name="serializedscene"></a>
905918

906919
Allows to serialize SceneAssets and use them in Runtime.
907920

@@ -926,7 +939,7 @@ Keep in mind that SerializedScene stores Scene's index, name and path. These pro
926939
Unfortunately, you need to handle associated objects reserialization by yourself, otherwise e.g. updated indexes won't be saved. I prepared for you a static event `SceneSerializationUtility.OnCacheRefreshed` that can be used to validate SerializedScenes in your project.
927940
You can link SerializedScene in a ScriptableObject and trigger reserialization (`EditorUtility.SetDirty()`) if needed, it's really convinient approach.
928941

929-
#### SerializedDictionary<TK, TV>
942+
#### SerializedDictionary<TK, TV> <a name="serializeddictionary"></a>
930943

931944
Allows to serialize and use Dictionaries. The presented class implements the IDictionary interface, so it can be easily used like the standard version.
932945

@@ -952,7 +965,7 @@ public void Usage()
952965
953966
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/dictionary2.png)
954967
955-
#### SerializedDateTime
968+
#### SerializedDateTime <a name="serializeddatetime"></a>
956969

957970
Allows to serialize DateTime.
958971

@@ -967,7 +980,7 @@ public void Usage()
967980

968981
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializeddate.png)
969982
970-
#### SerializedDirectory
983+
#### SerializedDirectory <a name="serializeddirectory"></a>
971984

972985
Allows to serialize folders in form of assets and retrieve direct paths in Runtime.
973986

Assets/Examples/Scripts/UI/CustomSelectable.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ public class CustomSelectable : Selectable
66
private interface ICustomLogic
77
{ }
88

9+
#if UNITY_2019_3_OR_NEWER
910
[SerializeReference]
1011
private ICustomLogic customLogic;
12+
#endif
1113
}

Docs/serializereferenceoperations.png

-4.64 KB
Loading

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ Unity 2018.x or newer
5656
- [Toolbox Custom Editors](#toolboxeditors)
5757
- [Material Drawers](#materialdrawers)
5858
- [Serialized Types](#serialized-types)
59+
- [SerializedType](#serializedtype)
60+
- [SerializedScene](#serializedscene)
61+
- [SerializedDictionary](#serializeddictionary)
62+
- [SerializedDateTime](#serializeddatetime)
63+
- [SerializedDirectory](#serializeddictionary)
5964
- [Editor Extensions](#editor-extensions)
6065
- [Hierarchy](#hierarchy)
6166
- [Project](#project)
@@ -777,6 +782,14 @@ public class ClassWithInterface3 : ClassWithInterfaceBase
777782

778783
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/referencepicker.png)
779784
785+
##### ReferencePicker properties
786+
787+
- **ParentType**: Indicates what *System.Type* should be used as 'base' to create a collection of all available inherited types.
788+
- **ForceUninitializedInstance** (false): If *true* - a new reference instance will be created without the standard construction flow and object will be uninitialized (constructor won't be called).
789+
- **TypeGrouping** (TypeGrouping.None): Indicates how the available types are displayed.
790+
- **AddTextSearchField** (true): If *true* - the popup picker will be extended with a text search field. It may be useful for larger type collections.
791+
- **AddConfimartionBox** (false): If *true* - creates an additional confirmation box to make sure that the new assignment is intended.
792+
780793
##### SerializeReference generics support
781794

782795
Unity 2023.x introduced support for serializing generic references.
@@ -885,7 +898,7 @@ _HideIfExample ("Range", Range(0, 1)) = 0.75
885898
886899
## Serialized Types
887900

888-
#### SerializedType
901+
#### SerializedType <a name="serializedtype"></a>
889902

890903
Allows to serialize Types and pick them through a dedicated picker.
891904

@@ -901,7 +914,7 @@ public void Usage()
901914

902915
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializedtype.png)
903916
904-
#### SerializedScene
917+
#### SerializedScene <a name="serializedscene"></a>
905918

906919
Allows to serialize SceneAssets and use them in Runtime.
907920

@@ -926,7 +939,7 @@ Keep in mind that SerializedScene stores Scene's index, name and path. These pro
926939
Unfortunately, you need to handle associated objects reserialization by yourself, otherwise e.g. updated indexes won't be saved. I prepared for you a static event `SceneSerializationUtility.OnCacheRefreshed` that can be used to validate SerializedScenes in your project.
927940
You can link SerializedScene in a ScriptableObject and trigger reserialization (`EditorUtility.SetDirty()`) if needed, it's really convinient approach.
928941

929-
#### SerializedDictionary<TK, TV>
942+
#### SerializedDictionary<TK, TV> <a name="serializeddictionary"></a>
930943

931944
Allows to serialize and use Dictionaries. The presented class implements the IDictionary interface, so it can be easily used like the standard version.
932945

@@ -952,7 +965,7 @@ public void Usage()
952965
953966
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/dictionary2.png)
954967
955-
#### SerializedDateTime
968+
#### SerializedDateTime <a name="serializeddatetime"></a>
956969

957970
Allows to serialize DateTime.
958971

@@ -967,7 +980,7 @@ public void Usage()
967980

968981
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializeddate.png)
969982
970-
#### SerializedDirectory
983+
#### SerializedDirectory <a name="serializeddirectory"></a>
971984

972985
Allows to serialize folders in form of assets and retrieve direct paths in Runtime.
973986

0 commit comments

Comments
 (0)