public void SetValues(LaunchLocation ToCopy) { if (ToCopy) { if (SuggestedForce) { SuggestedForce.Value = ToCopy.GetSuggestedForceToScore; } if (IdleLocation) { IdleLocation.Value = ToCopy.CameraIdleLocation.position; } if (LaunchLocation) { LaunchLocation.Value = ToCopy.CameraLaunchLocation.position; } } }
public virtual void PrepareShot(bool changeLaunchLocation) { IsBallLaunching = false; if (changeLaunchLocation || !currentRestartLocation) { LaunchLocation location = locations.GetRandomLocation(out currentLaunchLocationIndex, currentLaunchLocationIndex); currentRestartLocation = location.Location; locationFields.SetValues(location); } if (body) { body.MovePosition(currentRestartLocation.position); body.MoveRotation(currentRestartLocation.rotation); body.useGravity = false; body.velocity = Vector3.zero; body.angularVelocity = Vector3.zero; } }