public void PlayerThrowAction(bool value) { if (player_GolfBall != null && player_GolfBall == lastSpawned_player_GolfBall) { GolfBall golfBall = player_GolfBall.GetComponent <GolfBall>(); Trajectory trajectory = player_GolfBall.GetComponent <Trajectory>(); golfBall.Throw(golfBall.CalculateForce(player_GolfBall.transform.position, trajectory.lastMarkerObj.transform.position, 60f)); actualTimer = ballLifeTime; runTimer = true; autoThrow = value; throwUsed = true; } }
private void UpdateMarkers(float distanceValue) { for (int i = 0; i < maxNumberOfMarkers; i++) { markers[i].transform.position = golfBallScript.CalculatePosInTime(this.transform.position, lastMarkerObj.transform.position, golfBallScript.CalculateForce(this.transform.position, lastMarkerObj.transform.position, 60), maxNumberOfMarkers, i); } }