public void changeDir(Anim_Dir _dir) { switch (_dir) { case Anim_Dir.Right: currFrame = 0; startFrame = 0; endFrame = 3; break; case Anim_Dir.Left: currFrame = 3; startFrame = 3; endFrame = 6; break; case Anim_Dir.Up: currFrame = 6; startFrame = 9; endFrame = 9; break; case Anim_Dir.Down: currFrame = 9; startFrame = 9; endFrame = 11; break; } }
public void ChangeDir(Anim_Dir _dir) { //encapsulate actions. startFrame = currFrame = (int)_dir * totalFrame; endFrame = startFrame + totalFrame; // switch(_dir) // { // case Anim_Dir.Right: // currFrame = 0; // startFrame = 0; // endFrame = 3; // break; // case Anim_Dir.Left: // currFrame = 3; // startFrame = 3; // endFrame = 6; // break; // case Anim_Dir.Up: // currFrame = 6; // startFrame = 6; // endFrame = 9; // break; // case Anim_Dir.Down: // currFrame = 9; // startFrame = 9; // endFrame = 11; // break; // } }
public void ChangeDir(Anim_Dir _dir) // direction control { if (currDir = _dir) // to avoid holding dir key that animation paused { return; } else { //encapsulate actions. startFrame = currFrame = (int)_dir * totalFrame; endFrame = startFrame + totalFrame; } }
public void ChangeDir(Anim_Dir _dir) // direction control { //encapsulate actions. startFrame = currFrame = (int)_dir * totalFrame; endFrame = startFrame + totalFrame; }