-
-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
Description
If a Component has at least one SerializableInterface<> as a field, dragging and dropping a GameObject on any other variable throws an ArgumentOutOfRangeException.
Example code
using System;
using TNRD;
using UnityEngine;
public class CodeExample : MonoBehaviour
{
public SerializableInterface<IDog> AnInterface;
public GameObject OtherVariable; // Could also be a Component
}
public interface IDog { }
[Serializable]
public class Dog : IDog
{
public int age;
public GameObject face;
}Test performed
- Dragging and dropping any GameObject/Component on
OtherVariablethrows ArgumentOutOfRangeException. - Removing
AnInterfaceand doing step 1 won't throw error. - Dragging and dropping any GameObject/Component on a sibling Component that doesn't contain a SerializableInterface won't throw.
- If
AnInterfaceis assigned an instance of Dog, dragging and dropping any GameObject/Component on the Dog'sfacevariable won't throw an error
Stacktrace
The relevant part...
TNRD.Drawers.ReferenceDrawer.HandleDragPerform () (at Assets/Unity3D-SerializableInterface/Editor/Drawers/ReferenceDrawer.cs:196)
TNRD.Drawers.ReferenceDrawer.HandleDragAndDrop (UnityEngine.Rect position) (at Assets/Unity3D-SerializableInterface/Editor/Drawers/ReferenceDrawer.cs:114)
TNRD.Drawers.RawReferenceDrawer.OnGUI (UnityEngine.Rect position) (at Assets/Unity3D-SerializableInterface/Editor/Drawers/RawReferenceDrawer.cs:73)
TNRD.SerializableInterfacePropertyDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/Unity3D-SerializableInterface/Editor/SerializableInterfacePropertyDrawer.cs:48)ilovepatatos
Metadata
Metadata
Assignees
Labels
No labels