Example #1
0
 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;
         }
     }
 }
Example #2
0
    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;
        }
    }