public void SwitchCamera(UIPanel.MovementDirection direction) { switch (direction) { case UIPanel.MovementDirection.Up: case UIPanel.MovementDirection.Down: SwitchCameraVertical(direction); break; case UIPanel.MovementDirection.Left: case UIPanel.MovementDirection.Right: SwitchCameraHorizontal(direction); break; } }
public void OnRight(InputAction.CallbackContext context) { if (UDLRCameraController.Instance != null) { CubeController cubeController = GetCubeForCameraPanelPosition(UDLRCameraController.Instance.selectedPosition); if (cubeController != null) { //move cube according to selected camera CamAnimator selectedCam = UDLRCameraController.GetSelectedCameraAnimator(); Vector3 movementVec = selectedCam != null ? selectedCam.transform.right : Vector3.zero; movementVec.Normalize(); cubeController?.MoveInDirection(movementVec); lastMovementDirection = UIPanel.MovementDirection.Right; } } }
public void SwitchCameraHorizontal(UIPanel.MovementDirection direction) { Assert.IsTrue(direction == UIPanel.MovementDirection.Left || direction == UIPanel.MovementDirection.Right); selectedPosition = CameraPanel.SwitchPositionHorizontal(selectedPosition); panelController.PositionPanel(selectedPosition, direction); }
public void SwitchCameraVertical(UIPanel.MovementDirection direction) { Assert.IsTrue(direction == UIPanel.MovementDirection.Up || direction == UIPanel.MovementDirection.Down); selectedPosition = CameraPanel.SwitchPositionVertical(selectedPosition); panelController.PositionPanel(selectedPosition, direction); }