/// <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); }
/// <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); }