public GamepadInControlActionSet() { // Joystick Left = CreatePlayerAction("MoveLeft"); Right = CreatePlayerAction("MoveRight"); Up = CreatePlayerAction("MoveUp"); Down = CreatePlayerAction("MoveDown"); Movement = CreateTwoAxisPlayerAction(Left, Right, Down, Up); // Actions Jump = CreatePlayerAction("Jump"); Break = CreatePlayerAction("Break"); Dash = CreatePlayerAction("Dash"); Accelerate = CreatePlayerAction("Accelerate"); Desaccelerate = CreatePlayerAction("desaccelerate"); // Menu Command = CreatePlayerAction("Command"); }
/// <summary> /// Create an aggregate, double-axis action on this set. This should be performed in the constructor of your PlayerActionSet subclass. /// </summary> /// <example> /// Note that, due to Unity's positive up-vector, the parameter order of <c>negativeYAction</c> and <c>positiveYAction</c> might seem counter-intuitive. /// <code> /// Move = CreateTwoAxisPlayerAction( Left, Right, Down, Up ); /// </code> /// </example> /// <param name="negativeXAction">The action to query for the negative component of the X axis.</param> /// <param name="positiveXAction">The action to query for the positive component of the X axis.</param> /// <param name="negativeYAction">The action to query for the negative component of the Y axis.</param> /// <param name="positiveYAction">The action to query for the positive component of the Y axis.</param> protected PlayerTwoAxisAction CreateTwoAxisPlayerAction(PlayerAction negativeXAction, PlayerAction positiveXAction, PlayerAction negativeYAction, PlayerAction positiveYAction) { var action = new PlayerTwoAxisAction(negativeXAction, positiveXAction, negativeYAction, positiveYAction); twoAxisActions.Add(action); return(action); }
public PlayerActions() { this.Skills = new PlayerAction[4]; this.Shoot = this.CreatePlayerAction( "Shoot" ); for (int i = 0; i < 4; i++) { this.Skills[i] = this.CreatePlayerAction( "Skill" + i ); } this.YesOrOk = this.CreatePlayerAction( "Yes" ); this.NoOrBack = this.CreatePlayerAction ( "No" ); this.ILeft = this.CreatePlayerAction( "ILeft"); this.IRight = this.CreatePlayerAction( "IRight"); this.IUp = this.CreatePlayerAction( "IUp"); this.IDown = this.CreatePlayerAction( "IDown"); this.moveUp = this.CreatePlayerAction( "MoveUp" ); this.moveDown = this.CreatePlayerAction( "MoveDown" ); this.moveLeft = this.CreatePlayerAction( "MoveLeft" ); this.moveRight = this.CreatePlayerAction( "MoveRight" ); this.aimUp = this.CreatePlayerAction( "AimUp" ); this.aimDown = this.CreatePlayerAction( "AimDown" ); this.aimRight = this.CreatePlayerAction ( "AimRight" ); this.aimLeft = this.CreatePlayerAction ( "AimLeft" ); this.Movement = this.CreateTwoAxisPlayerAction(this.moveLeft, this.moveRight, this.moveDown, this.moveUp); this.Aim = this.CreateTwoAxisPlayerAction(this.aimLeft, this.aimRight, this.aimDown, this.aimUp); }
public PlayerActions() : base() { L_Left = CreatePlayerAction("Left stick left"); L_Right = CreatePlayerAction("Left stick right"); L_Up = CreatePlayerAction("Left stick up"); L_Down = CreatePlayerAction("Left stick down"); R_Left = CreatePlayerAction("Right stick left"); R_Right = CreatePlayerAction("Right stick right"); R_Up = CreatePlayerAction("Right stick up"); R_Down = CreatePlayerAction("Right stick down"); Move = CreateTwoAxisPlayerAction( L_Left, L_Right, L_Down, L_Up); Look = CreateTwoAxisPlayerAction( R_Left, R_Right, R_Down, R_Up); Fire = CreatePlayerAction("Fire"); Join = CreatePlayerAction("Join"); }
public PlayerControls() { MouseLeft = CreatePlayerAction("Mouse Left Click"); MouseRight = CreatePlayerAction("Mouse Right Click"); LookButton = CreatePlayerAction("Mouse look"); ZoomIn = CreatePlayerAction("Zoom in (mouse)"); ZoomOut = CreatePlayerAction("Zoom out (mouse)"); Zoom = CreateOneAxisPlayerAction(ZoomIn, ZoomOut); ZoomKeyboardIn = CreatePlayerAction("Zoom in (keyboard)"); ZoomKeyboardOut = CreatePlayerAction("Zoom out (keyboard)"); ZoomKeyboard = CreateOneAxisPlayerAction(ZoomKeyboardIn, ZoomKeyboardOut); MousePositiveX = CreatePlayerAction("Look positive X (mouse)"); MousePositiveY = CreatePlayerAction("Look positive Y (mouse)"); MouseNegativeX = CreatePlayerAction("Look negative X (mouse)"); MouseNegativeY = CreatePlayerAction("Look negative Y (mouse)"); LookMouse = CreateTwoAxisPlayerAction(MouseNegativeX, MousePositiveX, MouseNegativeY, MousePositiveY); KeyboardPositiveX = CreatePlayerAction("Look positive X (keyboard)"); KeyboardPositiveY = CreatePlayerAction("Look positive Y (keyboard)"); KeyboardNegativeX = CreatePlayerAction("Look negative X (keyboard)"); KeyboardNegativeY = CreatePlayerAction("Look negative Y (keyboard)"); LookKeyboard = CreateTwoAxisPlayerAction(KeyboardNegativeX, KeyboardPositiveX, KeyboardNegativeY, KeyboardPositiveY); }
public PlayerActions() { Fire = CreatePlayerAction( "Fire" ); Jump = CreatePlayerAction( "Jump" ); Left = CreatePlayerAction( "Move Left" ); Right = CreatePlayerAction( "Move Right" ); Up = CreatePlayerAction( "Move Up" ); Down = CreatePlayerAction( "Move Down" ); Move = CreateTwoAxisPlayerAction( Left, Right, Down, Up ); }
public PlayerActions() { attack = CreatePlayerAction("Attack"); target = CreatePlayerAction("Target"); right = CreatePlayerAction("Move Right"); left = CreatePlayerAction("Move Left"); up = CreatePlayerAction("Move Up"); down = CreatePlayerAction("Move Down"); move = CreateTwoAxisPlayerAction(left, right, down, up); }
public PlayerActions() { Green = CreatePlayerAction( "Green" ); Red = CreatePlayerAction( "Red" ); Blue = CreatePlayerAction( "Blue" ); Yellow = CreatePlayerAction( "Yellow" ); Left = CreatePlayerAction( "Left" ); Right = CreatePlayerAction( "Right" ); Up = CreatePlayerAction( "Up" ); Down = CreatePlayerAction( "Down" ); Rotate = CreateTwoAxisPlayerAction( Left, Right, Down, Up ); }
public BallActions() { Left = CreatePlayerAction( "Move Left" ); Right = CreatePlayerAction( "Move Right" ); Up = CreatePlayerAction( "Move Up" ); Down = CreatePlayerAction( "Move Down" ); Jump = CreatePlayerAction( "Jump" ); Shift = CreatePlayerAction ("Kinetic Shift"); Brake = CreatePlayerAction ("Brake"); Move = CreateOneAxisPlayerAction (Left, Right); JumpDirection = CreateTwoAxisPlayerAction (Left, Right, Down, Up); }
public ControllerPlayerActions() { _primaryLeft = this.CreatePlayerAction("Primary Left"); _primaryRight = this.CreatePlayerAction("Primary Right"); _primaryUp = this.CreatePlayerAction("Primary Up"); _primaryDown = this.CreatePlayerAction("Primary Down"); this.PrimaryDirection = this.CreateTwoAxisPlayerAction(_primaryLeft, _primaryRight, _primaryDown, _primaryUp); _secondaryLeft = this.CreatePlayerAction("Secondary Left"); _secondaryRight = this.CreatePlayerAction("Secondary Right"); _secondaryUp = this.CreatePlayerAction("Secondary Up"); _secondaryDown = this.CreatePlayerAction("Secondary Down"); this.SecondaryDirection = this.CreateTwoAxisPlayerAction(_secondaryLeft, _secondaryRight, _secondaryDown, _secondaryUp); }
public HeadActions() { Grab = CreatePlayerAction( "Grab" ); Left = CreatePlayerAction( "Left" ); Right = CreatePlayerAction( "Right" ); Up = CreatePlayerAction( "Up" ); Down = CreatePlayerAction( "Down" );; SpinLeft = CreatePlayerAction ("SpinLeft"); SpinRight = CreatePlayerAction ("SpinRight"); SpinForward = CreatePlayerAction ("SpinForward"); SpinBackward = CreatePlayerAction ("SpinBackward"); Raise = CreatePlayerAction("Raise"); Lower = CreatePlayerAction("Lower"); Height = CreateOneAxisPlayerAction(Lower, Raise); Rotate = CreateTwoAxisPlayerAction(SpinRight, SpinLeft, SpinForward, SpinBackward); Pan = CreateTwoAxisPlayerAction(Left,Right,Down,Up); }
public PlayerActions() { up = CreatePlayerAction("Move Up"); down = CreatePlayerAction("Move Down"); left = CreatePlayerAction("Move Left"); right = CreatePlayerAction("Move Right"); move = CreateTwoAxisPlayerAction(left, right, down, up); primary = CreatePlayerAction("Fire Primary"); secondary = CreatePlayerAction("Fire Secondary"); shield = CreatePlayerAction("Activate Shield"); item = CreatePlayerAction("Use Item"); pause = CreatePlayerAction("Pause"); quit = CreatePlayerAction("Quit"); }
public PlayerAction UseWeapon; // use equipped weapon (fire ranged weapon, use melee weapon) #endregion Fields #region Constructors public PlayerActions() { Left = CreatePlayerAction( "Move Left" ); Right = CreatePlayerAction( "Move Right" ); Up = CreatePlayerAction( "Move Up" ); Down = CreatePlayerAction( "Move Down" ); Move = CreateTwoAxisPlayerAction( Left, Right, Down, Up ); CamLeft = CreatePlayerAction( "Move Camera Left" ); CamRight = CreatePlayerAction( "Move Camera Right" ); CamUp = CreatePlayerAction( "Move Camera Up" ); CamDown = CreatePlayerAction( "Move Camera Down" ); CamMove = CreateTwoAxisPlayerAction( CamLeft, CamRight, CamDown, CamUp ); DodoInteraction = CreatePlayerAction( "Pick up/Throw Dodo" ); UseWeapon = CreatePlayerAction( "Use Equipped Weapon" ); ToggleRanged = CreatePlayerAction( "Equip/Unequip Range Weapon" ); Jump = CreatePlayerAction( "Jump" ); }
public PlayerActions() { //Move LeftMove = CreatePlayerAction("Move Left"); RightMove = CreatePlayerAction("Move Right"); UpMove = CreatePlayerAction("Move Up"); DownMove = CreatePlayerAction("Move Down"); Move = CreateTwoAxisPlayerAction(LeftMove, RightMove, DownMove, UpMove); //Aim LeftAim = CreatePlayerAction("Aim Left"); RightAim = CreatePlayerAction("Aim Right"); UpAim = CreatePlayerAction("Aim Up"); DownAim = CreatePlayerAction("Aim Down"); Aim = CreateTwoAxisPlayerAction(LeftAim, RightAim, DownAim, UpAim); //Shoot Shoot = CreatePlayerAction("Shoot"); }
public ChopstickActions01() { LStickLeft = CreatePlayerAction("Move LStick Left"); LStickRight = CreatePlayerAction("Move LStick Right"); LStickUp = CreatePlayerAction("Move LStick Up"); LStickDown = CreatePlayerAction("Move LStick Down"); LStickMove = CreateTwoAxisPlayerAction(LStickLeft, LStickRight, LStickDown, LStickUp); LStickRotateLeft = CreatePlayerAction("Rotate LStick Left"); LStickRotateRight = CreatePlayerAction("Rotate LStick Rigth"); LStickRotate = CreateOneAxisPlayerAction(LStickRotateLeft, LStickRotateRight); RStickLeft = CreatePlayerAction("Move RStick Left"); RStickRight = CreatePlayerAction("Move RStick Right"); RStickUp = CreatePlayerAction("Move RStick Up"); RStickDown = CreatePlayerAction("Move RStick Down"); RStickMove = CreateTwoAxisPlayerAction(RStickLeft, RStickRight, RStickDown, RStickUp); RStickRotateLeft = CreatePlayerAction("Rotate RStick Left"); RStickRotateRight = CreatePlayerAction("Rotate RStick Rigth"); RStickRotate = CreateOneAxisPlayerAction(RStickRotateLeft, RStickRotateRight); }
public PlayerActions() { Cast = CreatePlayerAction("Cast"); Shield = CreatePlayerAction("Shield"); Jump = CreatePlayerAction("Jump"); Earth = CreatePlayerAction("Earth"); Fire = CreatePlayerAction("Fire"); Water = CreatePlayerAction("Water"); MoveLeft = CreatePlayerAction("Move Left"); MoveRight = CreatePlayerAction("Move Right"); MoveUp = CreatePlayerAction("Move Up"); MoveDown = CreatePlayerAction("Move Down"); Move = CreateTwoAxisPlayerAction(MoveLeft, MoveRight, MoveDown, MoveUp); AimLeft = CreatePlayerAction("Aim Left"); AimRight = CreatePlayerAction("Aim Right"); AimUp = CreatePlayerAction("Aim Up"); AimDown = CreatePlayerAction("Aim Down"); Aim = CreateTwoAxisPlayerAction(AimLeft, AimRight, AimDown, AimUp); Dash = CreatePlayerAction("Dash"); }
public ShipActions() { lookLeft = CreatePlayerAction( "look x+" ); lookRight = CreatePlayerAction( "look x-" ); lookUp = CreatePlayerAction( "look y+" ); lookDown = CreatePlayerAction( "look y-" ); aAxs = CreateTwoAxisPlayerAction(lookLeft, lookRight, lookDown, //lord, lookDown lookUp); Left = CreatePlayerAction( "move x+" ); Right = CreatePlayerAction( "move x-" ); Up = CreatePlayerAction( "move y+" ); Down = CreatePlayerAction( "move y-" ); mAxs = CreateTwoAxisPlayerAction(Left, Right, Down, //breckfast Up); bL = CreatePlayerAction ("Bumper Left"); bR = CreatePlayerAction ("Bumper Right"); tL = CreatePlayerAction ("Trigger Left"); tR = CreatePlayerAction ("Trigger Right"); }
public TestInputSet() { expand = CreatePlayerAction("Expand"); //expand.AddDefaultBinding(Mouse.RightButton); //expand.AddDefaultBinding(Key.Space); //expand.AddDefaultBinding(InputControlType.Action4); cancel = CreatePlayerAction("Cancel"); cancel.AddDefaultBinding(Mouse.RightButton); cancel.AddDefaultBinding(Key.Escape); cancel.AddDefaultBinding(InputControlType.Action2); { var up = CreatePlayerAction("Up"); var down = CreatePlayerAction("Down"); var left = CreatePlayerAction("Left"); var right = CreatePlayerAction("Right"); up.AddDefaultBinding(Key.W); down.AddDefaultBinding(Key.S); left.AddDefaultBinding(Key.A); right.AddDefaultBinding(Key.D); up.AddDefaultBinding(InputControlType.LeftStickUp); down.AddDefaultBinding(InputControlType.LeftStickDown); left.AddDefaultBinding(InputControlType.LeftStickLeft); right.AddDefaultBinding(InputControlType.LeftStickRight); move = CreateTwoAxisPlayerAction(left, right, down, up); move.StateThreshold = 0.5f; } { var cw = CreatePlayerAction("Turn CW"); var acw = CreatePlayerAction("Turn ACW"); cw.AddDefaultBinding(Key.E); acw.AddDefaultBinding(Key.Q); turn = CreateOneAxisPlayerAction(cw, acw); } { var up = CreatePlayerAction("Cursor Up"); var down = CreatePlayerAction("Cursor Down"); var left = CreatePlayerAction("Cursor Left"); var right = CreatePlayerAction("Cursor Right"); up.AddDefaultBinding(InputControlType.RightStickUp); down.AddDefaultBinding(InputControlType.RightStickDown); left.AddDefaultBinding(InputControlType.RightStickLeft); right.AddDefaultBinding(InputControlType.RightStickRight); cursor = CreateTwoAxisPlayerAction(left, right, down, up); click = CreatePlayerAction("Cursor Click"); click.AddDefaultBinding(InputControlType.RightTrigger); } { var zoomIn = CreatePlayerAction("Zoom In"); var zoomOut = CreatePlayerAction("Zoom Out"); zoomIn.AddDefaultBinding(InputControlType.LeftStickButton); zoomOut.AddDefaultBinding(InputControlType.RightStickButton); zoomIn.AddDefaultBinding(Key.Equals); zoomOut.AddDefaultBinding(Key.Minus); zoom = CreateOneAxisPlayerAction(zoomOut, zoomIn); } }
private void configureMovementActions() { MoveLeft = initializeAction( MovementActions.LEFT ); MoveRight = initializeAction( MovementActions.RIGHT ); MoveForward = initializeAction( MovementActions.FORWARD ); MoveBackward = initializeAction( MovementActions.BACKWARD ); Move = initializeAction( MoveLeft, MoveRight, MoveBackward, MoveForward ); }
public PlayerInput(bool haveGamepad) { _left = CreatePlayerAction("Move Left"); _right = CreatePlayerAction("Move Right"); _up = CreatePlayerAction("Move Up"); _down = CreatePlayerAction("Move Down"); move = CreateTwoAxisPlayerAction(_left, _right, _down, _up); _shootLeft = CreatePlayerAction("Shoot Left"); _shootRight = CreatePlayerAction("Shoot Right"); _shootUp = CreatePlayerAction("Shoot Up"); _shootDown = CreatePlayerAction("Shoot Down"); shoot = CreateTwoAxisPlayerAction(_shootLeft, _shootRight, _shootDown, _shootUp); //Gamepad if(haveGamepad) { _left.AddDefaultBinding(InputControlType.LeftStickLeft); _right.AddDefaultBinding(InputControlType.LeftStickRight); _up.AddDefaultBinding(InputControlType.LeftStickUp); _down.AddDefaultBinding(InputControlType.LeftStickDown); _left.AddDefaultBinding(InputControlType.DPadLeft); _right.AddDefaultBinding(InputControlType.DPadRight); _up.AddDefaultBinding(InputControlType.DPadUp); _down.AddDefaultBinding(InputControlType.DPadDown); _shootLeft.AddDefaultBinding(InputControlType.RightStickLeft); _shootRight.AddDefaultBinding(InputControlType.RightStickRight); _shootUp.AddDefaultBinding(InputControlType.RightStickUp); _shootDown.AddDefaultBinding(InputControlType.RightStickDown); _shootLeft.AddDefaultBinding(InputControlType.Action3); _shootRight.AddDefaultBinding(InputControlType.Action2); _shootUp.AddDefaultBinding(InputControlType.Action4); _shootDown.AddDefaultBinding(InputControlType.Action1); } else { _left.AddDefaultBinding(Key.LeftArrow); _right.AddDefaultBinding(Key.RightArrow); _up.AddDefaultBinding(Key.UpArrow); _down.AddDefaultBinding(Key.DownArrow); _shootLeft.AddDefaultBinding(Key.A); _shootRight.AddDefaultBinding(Key.D); _shootUp.AddDefaultBinding(Key.W); _shootDown.AddDefaultBinding(Key.S); } }
private void configureCameraActions() { LookLeft = initializeAction( CameraActions.LEFT ); LookRight = initializeAction( CameraActions.RIGHT ); LookUp = initializeAction( CameraActions.UP ); LookDown = initializeAction( CameraActions.DOWN ); Look = initializeAction( LookLeft, LookRight, LookUp, LookDown ); }
/// <summary> /// Create an aggregate, double-axis action on this set. This should be performed in the constructor of your PlayerActionSet subclass. /// </summary> /// <example> /// Note that, due to Unity's positive up-vector, the parameter order of <c>negativeYAction</c> and <c>positiveYAction</c> might seem counter-intuitive. /// <code> /// Move = CreateTwoAxisPlayerAction( Left, Right, Down, Up ); /// </code> /// </example> /// <param name="negativeXAction">The action to query for the negative component of the X axis.</param> /// <param name="positiveXAction">The action to query for the positive component of the X axis.</param> /// <param name="negativeYAction">The action to query for the negative component of the Y axis.</param> /// <param name="positiveYAction">The action to query for the positive component of the Y axis.</param> protected PlayerTwoAxisAction CreateTwoAxisPlayerAction( PlayerAction negativeXAction, PlayerAction positiveXAction, PlayerAction negativeYAction, PlayerAction positiveYAction ) { var action = new PlayerTwoAxisAction( negativeXAction, positiveXAction, negativeYAction, positiveYAction ); twoAxisActions.Add( action ); return action; }