If you notice that when a new script is added with default template, you have YourClass.prototype, this is sort of extend/inherit the YourClass class. Prototype just adds more functionality to an existing class
Virtuals and overrides are just basically recreate the parent functions in children, pretty much you can search for the net for it, here is one quite good on stackoverflow
But with PlayCanvas, I think we can make these work in PlayCanvas way i.e:
- Create a bunch of “reusable” components such as FollowMouse.js, SelfRotate.js, MoveToward.js etc. you can call them as base classes if you want
- Attached them to the same working entity, then on the main script, we just go this.entity.script.FollowMouse.DoStuff() for example, where DoStuff() is an “inherited” function from the “base” FollowMouse class
Hope these help!