Exemple #1
0
    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;
        }
    }
Exemple #2
0
 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;
         }
     }
 }
Exemple #3
0
 public void SwitchCameraHorizontal(UIPanel.MovementDirection direction)
 {
     Assert.IsTrue(direction == UIPanel.MovementDirection.Left || direction == UIPanel.MovementDirection.Right);
     selectedPosition = CameraPanel.SwitchPositionHorizontal(selectedPosition);
     panelController.PositionPanel(selectedPosition, direction);
 }
Exemple #4
0
 public void SwitchCameraVertical(UIPanel.MovementDirection direction)
 {
     Assert.IsTrue(direction == UIPanel.MovementDirection.Up || direction == UIPanel.MovementDirection.Down);
     selectedPosition = CameraPanel.SwitchPositionVertical(selectedPosition);
     panelController.PositionPanel(selectedPosition, direction);
 }