jeudi 10 septembre 2020

Is it better to implement two classes with the same methodnames or one class with with more methods?

I am implementing an unity game. I have two Classes for my two Objects. One can click on both of the objects. I have two "MouseManager" classes, for each Object-class one. A click is perceived and processed by the MouseManager script.

Is it a good solution to have the two classes with the same methodnames Start() and Update() with different code in them or would it better to have just one class and to implement the methods Start1(), Start2(), Update1(), Update2() and ask in Start() and Update() which class calls the MouseManagerScript and to call the specific method with 1 oder 2 depending on this.

Aucun commentaire:

Enregistrer un commentaire