private void DoPreviewUpdate() { //Check if the preview camera has finsihed and we are not already changing camera LevelPreviewCamera previewCamera = (LevelPreviewCamera)holeCameraManager.levelPreviewCamera; if (!previewCamera.FollowingRoute && !holeCameraManager.IsTransitioning(holeCameraManager.levelPreviewCamera, holeCameraManager.ballCamera)) { //Change Camera to ball camera holeCameraManager.InitiateCameraTransision(holeCameraManager.levelPreviewCamera, holeCameraManager.ballCamera); previewCameraReturning = true; //Activate ball camera without movement or camera drawing so that it is sat in the correct position } if (previewCameraReturning) { if (!holeCameraManager.IsTransitioning(holeCameraManager.levelPreviewCamera, holeCameraManager.ballCamera)) { holeCameraManager.levelPreviewCamera.gameObject.SetActive(false); holeCameraManager.ballCamera.gameObject.SetActive(true); //Initalise Playing State StartPlayingState(); } } }
/// <summary> /// Gets the total distance of this hole /// </summary> /// <returns></returns> public float GetHoleDistance() { LevelPreviewCamera levelPreviewCamera = (LevelPreviewCamera)holeCameraManager.levelPreviewCamera; return(levelPreviewCamera.GetCameraPathDistance()); }