private void FixedUpdate() { velocityTransformed = upDirection.SpaceEnter(velocityReader.GetVelocity()); switch (directions) { case Directions.Horizontal: RotateHorizontal(); break; case Directions.Vertical: RotateVertical(); break; case Directions.Both: RotateHorizontal(); RotateVertical(); break; } }
// Retrieves the GameObject's velocity relative to up space. public Vector2 GetVelocity() { return(upDirection.SpaceEnter(mover.GetVelocity())); }
private void FixedUpdate() { rotator.SetAngle(Angle.FromHeadingVector(mover.GetVelocity())); //UtilHeading2D.DegreesFromHeadingVector(mover.GetVelocity())); }