Unity-SerializeReferenceExtensions icon indicating copy to clipboard operation
Unity-SerializeReferenceExtensions copied to clipboard

[FEATURE] Add SerializedDictionary support

Open Nitero opened this issue 1 year ago • 0 comments

Feature description

I'm not sure if this belongs in here or in the SerializedDictionary plugin that I use, but it would be great if it was compatable out of the box instead of having to make wrappers.

public class Example : MonoBehaviour
{
    [SerializeField]
    private SerializedDictionary<TargetWrapper, float> _configurableTarget; // works

    [SerializeField, SubclassSelector]
    private SerializedDictionary<ITarget, float> _configurableTarget2; // doesnt work
}

[Serializable]
public struct TargetWrapper
{
    [SerializeReference, SubclassSelector]
    public ITarget target;
}

public interface ITarget
{
}

[Serializable]
public class ConcreteTarget : ITarget
{
}

Nitero avatar Dec 18 '24 22:12 Nitero