component not detecting parent class
Say I have class A. Then I make class B that inherits from class A.
I put the class B script on a gameobject in the scene.
I have a separate gameobject that has a component on it.
this component expects a reference to Class A.
i.e. public A testVar;
I try to drag and drop the gameobject with class B attached to it into the reference field of the component.
However it doesn't work. Why not? Shouldn't it be fine since it extends to the class it expects?
Any wisdom is most appreciated.
how did you declare class A? I just tested this case and it works with class A being a valid $$anonymous$$onobehaviour derived class itself. No abstract, no generic.
namespace Devdog.InventoryPro
{
public abstract class ItemCollectionSlotUIBase : $$anonymous$$onoBehaviour, IPoolable, ISelectHandler, ICollectionItem
{
...
Another note is that this seems to work fine in Unity 5.4 but breaks in 5.5
namespace Devdog.InventoryPro
{
public partial class ItemCollectionSlotUI : ItemCollectionSlotUIBase, IBeginDragHandler, IEndDragHandler, IDragHandler, IPointerUpHandler, IPointerDownHandler, IPointerEnterHandler, IPointerExitHandler
{
....
and this would be the class that inherits from the first one.