/// <summary> /// Moves the camera if it is specified /// </summary> private void MoveCamera_() { // if the camera is moving to the left if (_cameraMoving == ChefCameraMovement.Left) { // move to the left ChefCamera.transform.Translate(new Vector3(-CAMERA_SPEED * Time.deltaTime, 0, 0)); // stop at end if (ChefCamera.transform.localPosition.x < CameraPositionLeft) { _cameraMoving = ChefCameraMovement.None; } } // if the camera is moving to the right else if (_cameraMoving == ChefCameraMovement.Right) { // move to the right ChefCamera.transform.Translate(new Vector3(CAMERA_SPEED * Time.deltaTime, 0, 0)); // stop at end if (ChefCamera.transform.localPosition.x > CameraPositionRight) { _cameraMoving = ChefCameraMovement.None; } } }
/// <summary> /// Starts moving the camera to the right /// </summary> public void CameraRight_() { _cameraMoving = ChefCameraMovement.Right; SelectionSpatula.gameObject.SetActive(false); SelectionHand.gameObject.SetActive(true); }