↧
Answer by Mike G for Add onto method in parent class from inherited class
I see two problems here, one in your code sample and one in your understanding of how overriding works.Start() is already defined as a protected virtual method of the parent class. Your definition in...
View ArticleAnswer by Jalal Mostafa for Add onto method in parent class from inherited class
Add override keyword.protected override void Start(){ base.Start(); DoSomethingElse();}
View ArticleAnswer by Jakub Lortz for Add onto method in parent class from inherited class
You can use base to call the base class' implementation of Start(). You also have to override the virtual method in the child class:protected override void Start () { base.Start(); BlahBlahBlah();...
View ArticleAdd onto method in parent class from inherited class
Suppose that you have a function in the parent class, it does x and y. But now in the inherited class, you want to make the function also do z. You can't overwrite it because that would mean that the...
View Article