- Home /
Question... Use the switch to update or function
I know this is not a means to ask questions so little full of context , but my disadvantage is to ask for the most viable way to use a switch. if I leave it in the update obcion charged if the first is true , for example : public int val=0;
void Update(){
switch(val){
case 0:
//sentence
break;
}
}
or they are fuction:
funtionForSwitch(int val){
switch(val){
case 0:
//sentence
break;
}
}
My idea is that when in the update, always load the first case and I think that if I put several objects with an identical script , would have confrictos between them, and if I use a fucion , I think it would have to adjdicarcela to a button or some conditional to be activated . could you tell me which is more practical . or if they have some kind of view. They are the thanks
Your answer
Follow this Question
Related Questions
code to update level repeats how do i call and hold the funtion 0 Answers
checking multiple textures at once using functio update 1 Answer
Why doesen't the function get called the second itme? 1 Answer
Switch statement not running on every frame 1 Answer
Performance Optimization ~Function Update: Loop or Once ? 5 Answers