c# - Best Practice Unity, to create different scripts or use switch-cases? -


i'm developing game on unity. there units, different functionalities somehow same attributes.

what should do?

create different script each kind or make single switch-cases , functions accordingly ?

what best practice do?

thanks in advance :)

for example: have angry guy , calm guy, have 1 basic inheritance of person class, inherited same class unit, in have different switch cases determine angry , happy , calm , etc. should make different classes each of right way ?

how using inheritance? https://msdn.microsoft.com/en-us/library/ms173149.aspx

public abstract class baseunit{     public void virtual dosomething(){          // default code    }      }  public class myunittype : baseunit{   public override void dosomething(){      // custom code if no want default logic   } } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -