I’ve looked all over but cant find anything about how to fix this. How do I get the Foo function to call the overridden function from derived?
class Base : MonoBehaviour{
public virtual void Foo(){
//Something
}
}
class Derived : Base{
public override void Foo(){
//Something else
}
}
class BaseController : MonoBehaviour{
List<Base> L = new List<Base>(); // This is filled with bases and deriveds
void Update(){
foreach(var i in L){
i.Foo(); // Only calls foo from base class
}
}
}
Ideas?
EDIT: Fixed typos