public void ToggleAnimationEditor() { float x = 0; if (animPosition >= 1) { x = -1; } else if (animPosition <= 0) { x = 1; } else { x = animSpeed * -1; } PlayAnimation(x); }