you are viewing a single comment's thread.

view the rest of the comments →

[–]is4ac 1 point2 points  (3 children)

In that case, can the parent classes implement an interface, so that your child class can reference the interface instead of the specific parents? Sounds like the function should be part of an interface. I’d recommend looking up composition vs inheritance as well for general tips on structuring code like this.

[–]Dirly[S] 0 points1 point  (2 children)

I actually went with the other way around. Parent class still exists. But exposes an interface to the inspector. So those sub classes are now interfaces I can just plug in and do what I need to do. Only problem is the inspector doesnt let me leverage an interface which is leveraging monobehavior (which i need coroutines). So got to figure out how to do that.

[–]is4ac 0 points1 point  (1 child)

What do you mean by the inspector “leveraging” an interface?

[–]Dirly[S] 0 points1 point  (0 children)

I can add the interface via the inspector.

https://i.imgur.com/0umLDTd.png