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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -