Author Topic: Reminder to allow inheritance :p  (Read 1034 times)


  • Junior Playmaker
  • **
  • Posts: 99
    • View Profile
Reminder to allow inheritance :p
« on: November 26, 2013, 08:28:41 AM »

the couple of times i tried to add a small feature to a existing action, i always did run into the problem that the common used "DoXY" function or some cached field was not declared "protected/virtual".

As example i tried to extent the GetComponent action to allow childs, but unfortunally i have to copy&paste the whole action, rather than extending + override "DoGetComponent".

So if possible declare those calls as virtual and other fields/cache as protected. If needed rather use "sealed" on the class, if its not designed to-be inherited.

Thx Andy
« Last Edit: November 26, 2013, 08:38:15 AM by Andy22 »