Skip to content

Commit eab215d

Browse files
committed
Update README.md
1 parent b24ee96 commit eab215d

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

17.3 KB
Loading
13.9 KB
Loading

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,41 @@ 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+
```csharp
700+
[SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.None)]
701+
public IGenericInterface<string> genericString;
702+
[SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.None)]
703+
public IGenericInterface<int> genericInt;
704+
[SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.None)]
705+
public IGenericInterface<bool> genericBool;
706+
707+
public interface IGenericInterface<TValue>
708+
{
709+
TValue Value { get; }
710+
}
711+
712+
public class GenericInterfaceImplementation<TValue> : IGenericInterface<TValue>
713+
{
714+
[SerializeField]
715+
private TValue value;
716+
717+
public TValue Value => value;
718+
}
719+
```
720+
721+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializereferencegenerics.png)
722+
723+
##### SerializeReference context menu operations
724+
725+
You can use few custom context menu operations for the SerializeReference-based fields:
726+
- Copy Serialize Reference: creates deep copy of linked reference
727+
- Paste Serialize Reference: allows to paste preserved copy to a fields
728+
- Duplicate Serialize Reference: allows to duplicate linked reference (works only on collection elements)
729+
730+
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializereferenceoperations.png)
731+
697732
#### Custom Editors <a name="toolboxeditors"></a>
698733

699734
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.

0 commit comments

Comments
 (0)