public void Command(CharacterCommands command, params object[] args) { customAnimation = null; switch(command) { case CharacterCommands.Step: state = 1; d = (Directions)args[0]; walkAnims[(int)d].reset(); return; case CharacterCommands.Face: //if(state == 1 && d == (Directions)args[0]) { } //else //state = 0; if(d != (Directions)args[0]) state = 0; d = (Directions)args[0]; return; case CharacterCommands.Stop: state = 0; return; case CharacterCommands.Walk: if(d == (Directions)args[0] && state == 1) { } else { state = 1; walkAnims[(int)(Directions)args[0]].reset(); d = (Directions)args[0]; } return; case CharacterCommands.Animate: state = 3; customAnimation = new StandardChrAnimationController((string)args[0]); customAnimation.reset(); return; default: return; } }
public V3ChrController(V3Chr chr) { this.chr = chr; for(int i=1;i<9;i++) walkAnims[i] = new StandardChrAnimationController(chr.anims[i]); }