Search Unity

Curiosity over Overriding method and creating new one

Discussion in 'Scripting' started by 987054win, Jul 30, 2014.

  1. 987054win

    987054win

    Joined:
    Apr 12, 2014
    Posts:
    27
    Why do someone overriding a method and changing its content rather than creating a new method, what is the difference between them. Is it a performance issue or other things? anyone knows the answer plsss help. Thks in advance.
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    That's a fundamental part of OOP. You have a class work with Animal, call Growl on the animal, and have the subclass determine what to actually do.

    Polymorhpism