Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.11 KB | None | 0 0
  1. namespace NSNagasaki
  2. {
  3.     using System.Collections.Generic;
  4.     using InControl;
  5.     using NSEipix.Base;
  6.     using UnityEngine;
  7.  
  8.     public class InputManager : Singleton<InputManager>
  9.     {
  10.         private PlayerControls controls;
  11.         private PlayerMenuControls menuControls;
  12.         private Dictionary<InputType, PlayerAction> inputControls;
  13. <<<<<<< .mine
  14.         private Dictionary<InputType, PlayerTwoAxisAction> twoAxisInputControls;
  15. ||||||| .r83
  16. =======
  17.         private Dictionary<InputType, PlayerAction> inputControlsUi;
  18. >>>>>>> .r99
  19.  
  20.         private InputManager()
  21.         {
  22.             this.controls = new PlayerControls();
  23.  
  24.             this.inputControls = new Dictionary<InputType, PlayerAction>();
  25.             this.twoAxisInputControls = new Dictionary<InputType, PlayerTwoAxisAction>();
  26.             this.inputControls.Add(InputType.Left, this.controls.MoveLeft);
  27.             this.inputControls.Add(InputType.Right, this.controls.MoveRight);
  28.             this.inputControls.Add(InputType.Up, this.controls.MoveUp);
  29.             this.inputControls.Add(InputType.Down, this.controls.MoveDown);
  30.             this.inputControls.Add(InputType.Jump, this.controls.Jump);
  31.             this.inputControls.Add(InputType.Crouch, this.controls.Crouch);
  32.             this.inputControls.Add(InputType.ZoomIn, this.controls.ZoomIn);
  33.             this.inputControls.Add(InputType.ZoomOut, this.controls.ZoomOut);
  34.             this.inputControls.Add(InputType.Run, this.controls.Run);
  35.             this.inputControls.Add(InputType.MouseXPositive, this.controls.MouseMovementXpositive);
  36.             this.inputControls.Add(InputType.MouseYPositive, this.controls.MouseMovementYpositive);
  37.             this.inputControls.Add(InputType.MouseXNegative, this.controls.MouseMovementXnegative);
  38.             this.inputControls.Add(InputType.MouseYNegative, this.controls.MouseMovementYnegative);
  39.             this.twoAxisInputControls.Add(InputType.MouseMove, this.controls.MouseMovement);
  40.  
  41.             this.menuControls = new PlayerMenuControls();
  42.  
  43.             this.inputControlsUi = new Dictionary<InputType, PlayerAction>();
  44.             this.inputControlsUi.Add(InputType.Menu, this.menuControls.MenuOpen);
  45.  
  46.             GameManager.Instance.TickFixedUpdate += this.GetInput;
  47.         }
  48.  
  49.         public bool WasButtonPressed(InputType inputType)
  50.         {
  51.             return this.inputControls[inputType].WasPressed;
  52.         }
  53.  
  54.         public bool WasButtonReleased(InputType inputType)
  55.         {
  56.             return this.inputControls[inputType].WasReleased;
  57.         }
  58.  
  59.         public bool IsButtonPressed(InputType inputType)
  60.         {
  61.             return this.inputControls[inputType].IsPressed;
  62.         }
  63.  
  64. <<<<<<< .mine
  65.         public Vector2 IsControllMovedTwoAxis(InputType inputType)
  66.         {
  67.             return this.twoAxisInputControls[inputType].Value;
  68.         }
  69.  
  70. ||||||| .r83
  71. =======
  72.         public bool WasUiButtonPressed(InputType inputType)
  73.         {
  74.             return this.inputControlsUi[inputType].WasPressed;
  75.         }
  76.  
  77. >>>>>>> .r99
  78.         public void GetInput(float deltaTime)
  79.         {
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement