Skip to content

Releases: AlexeyTaranov/SerializeReferenceDropdown

0.4.0 Generics support

21 Mar 14:08
Compare
Choose a tag to compare

Unity 2023.2 support generics!

image
Code Example
public class TestShapesForSRD : MonoBehaviour
{
    [SerializeReference, SerializeReferenceDropdown]
    private ISimpleGenericData<int> _intData;
}

public interface ISimpleGenericData<TData> : IAbstractData
{
    public TData Data { get; }
}

[Serializable]
public class GenericData<TData> : ISimpleGenericData<TData>
{
    [SerializeField] private TData _data;

    public TData Data => _data;
}

[Serializable]
public class GenericKeyValuePair<TKeyData, TValueData> : ISimpleGenericData<TKeyData>, IAbstractData
{
    [SerializeField] private TKeyData _key;
    [SerializeField] private TValueData _value;
    public TKeyData Data => _key;
}

Version 0.1.1: Improved performance

05 Jun 09:10
Compare
Choose a tag to compare
Pre-release

Version 0.1.1: Improved performance

Improved performance: select types with TypeCache

https://docs.unity3d.com/ScriptReference/TypeCache.html

Simplified code