/** Configures and syncs properties required on a state change */ void SyncState() { if (WorldState.ball != currentState) { currentState = WorldState.ball; switch (currentState) { case BallState.Air: var velocity = Mathf.Max((transform.position - target.position).magnitude, 20); steering = new Steering(); steering.velocity = Throwing.Velocity(transform.position, target.position + new Vector3(0, BallController.floorHeight, 0), velocity, gravity); break; } } }