public PlayerActions() { Left = CreatePlayerAction( "Move Left" ); Right = CreatePlayerAction( "Move Right" ); Up = CreatePlayerAction( "Move Up" ); Down = CreatePlayerAction( "Move Down" ); }
internal PlayerOneAxisAction( PlayerAction negativeAction, PlayerAction positiveAction ) { this.negativeAction = negativeAction; this.positiveAction = positiveAction; Raw = true; }
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 Arm(Actor pActor, MonkeyAnimations.BodyRegion pRegion, InControl.PlayerAction targetInput) { actor = pActor; region = pRegion; inputToWatch = targetInput; PushArmState(new ArmNormalState(), "Initialization of " + Enum.GetName(typeof(MonkeyAnimations.BodyRegion), region) + "arm"); }
internal PlayerTwoAxisAction( PlayerAction negativeXAction, PlayerAction positiveXAction, PlayerAction negativeYAction, PlayerAction positiveYAction ) { this.negativeXAction = negativeXAction; this.positiveXAction = positiveXAction; this.negativeYAction = negativeYAction; this.positiveYAction = positiveYAction; Raw = true; }
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 PlayerAction() { Pause = CreatePlayerAction("Pause"); Punch = CreatePlayerAction("Punch"); Kick = CreatePlayerAction("Kick"); Roll = CreatePlayerAction("Roll"); Blank = CreatePlayerAction("Blank"); Level1 = CreatePlayerAction("Level1"); Controls = CreatePlayerAction("Controls"); Skip = CreatePlayerAction("Skip"); }
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 PlayerActions() { _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); }
/// <summary> /// Create an action on this set. This should be performed in the constructor of your PlayerActionSet subclass. /// </summary> /// <param name="name">A unique identifier for this action within the context of this set.</param> /// <exception cref="InControlException">Thrown when trying to create an action with a non-unique name for this set.</exception> protected PlayerAction CreatePlayerAction( string name ) { var action = new PlayerAction( name, this ); action.Device = Device ?? InputManager.ActiveDevice; if (actionsByName.ContainsKey( name )) { throw new InControlException( "Action '" + name + "' already exists in this set." ); } actions.Add( action ); actionsByName.Add( name, action ); return action; }
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"); }
/// <summary> /// Create an aggregate, single-axis action on this set. This should be performed in the constructor of your PlayerActionSet subclass. /// </summary> /// <example> /// <code> /// Throttle = CreateOneAxisPlayerAction( Brake, Accelerate ); /// </code> /// </example> /// <param name="negativeAction">The action to query for the negative component of the axis.</param> /// <param name="positiveAction">The action to query for the positive component of the axis.</param> protected PlayerOneAxisAction CreateOneAxisPlayerAction( PlayerAction negativeAction, PlayerAction positiveAction ) { var action = new PlayerOneAxisAction( negativeAction, positiveAction ); oneAxisActions.Add( action ); return action; }
/// <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; }
internal PlayerOneAxisAction(PlayerAction negativeAction, PlayerAction positiveAction) { this.negativeAction = negativeAction; this.positiveAction = positiveAction; Raw = true; }
/// <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 IEnumerator ListenForConcedeOrAnyKey(PlayerInputs inputs, System.Action onKey, System.Action onAnyKey, InControl.PlayerAction onAction) { yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); while (!Input.anyKeyDown) { if (onAction.WasPressed) { onKey.Invoke(); Destroy(gameObject, 0.2f); yield break; } //NEED an ANYBUTTON HERE TO CANCEL if (inputs.goBack.WasPressed) { onAnyKey.Invoke(); Destroy(gameObject, 0.2f); yield break; } yield return(null); } if (inputs.concede.WasPressed) { onKey.Invoke(); Destroy(gameObject, 0.2f); yield break; } if (Input.GetMouseButton(0)) { yield return(new WaitForSeconds(.2f)); } onAnyKey.Invoke(); Destroy(gameObject, 0.2f); yield break; }
internal PlayerTwoAxisAction(PlayerAction negativeXAction, PlayerAction positiveXAction, PlayerAction negativeYAction, PlayerAction positiveYAction) { this.negativeXAction = negativeXAction; this.positiveXAction = positiveXAction; this.negativeYAction = negativeYAction; this.positiveYAction = positiveYAction; InvertXAxis = false; InvertYAxis = false; Raw = true; }
/// <summary> /// Create an aggregate, single-axis action on this set. This should be performed in the constructor of your PlayerActionSet subclass. /// </summary> /// <example> /// <code> /// Throttle = CreateOneAxisPlayerAction( Brake, Accelerate ); /// </code> /// </example> /// <param name="negativeAction">The action to query for the negative component of the axis.</param> /// <param name="positiveAction">The action to query for the positive component of the axis.</param> protected PlayerOneAxisAction CreateOneAxisPlayerAction(PlayerAction negativeAction, PlayerAction positiveAction) { var action = new PlayerOneAxisAction(negativeAction, positiveAction); oneAxisActions.Add(action); return(action); }
public void Listen(PlayerInputs inputs, System.Action onKey, System.Action onAnyKey, InControl.PlayerAction onAction) { StartCoroutine(ListenForConcedeOrAnyKey(inputs, onKey, onAnyKey, onAction)); }