public void ProcessInput(Vector3 input) { var newWay = DefineMovingWay(input); if (newWay != currentWay && !AreWaysOpposite(newWay, currentWay)) { OnWayChanged.Invoke(); currentWay = newWay; } }
public void Reset() { currentWay = MovingWay.Up; }
private bool AreWaysOpposite(MovingWay newWay, MovingWay currentWay) { return(Mathf.Abs(newWay - currentWay) == 1); }