Click or drag to resize

InputMapperConflictFoundEventDataIsSwapAllowed Method

Is swapping allowed for the current assignment? You must check this before passing Swap to responseCallback. Do not pass Swap to responseCallback if this function returns false. Swapping is only allowed if all of the following conditions are met: 1. Assignment must be a replacement assignment of an existing mapping. 2. Only one conflicting mapping was found. 3. Conflicting mapping is not protected. 4. Conflicting mapping belongs to the same Player as the new assignment. Due to the complexity of swapping full-axis and split-axis / button mappings, some swap operations may result in the creation of additional positive-pole mappings to an Axis-type Action. To avoid creation of more mappings than can be displayed in the UI, pass the maximum number of columns your UI supports for the specific controller type to maxInputFieldCount to prevent this. If there is no more room for a new mapping visually, this function will return false. To ignore input field count limits, pass 0 to maxInputFieldCount.

Namespace:  Rewired
Assembly:  Rewired_Core (in Rewired_Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public bool IsSwapAllowed(
	int maxInputFieldCount
)

Parameters

maxInputFieldCount
Type: SystemInt32
The maximum number of input mapping fields per-Action visible to the user for the current controller type. Example: If your UI displays two columns of input mapping fields for a Joystick, set this value to 2. If a swap operation would result in the creation of extra mappings that would overflow the visible space for mappings (swapping between a full-axis mapping and a button for example), this function will return false and swap will not be allowed. If the UI has no column limit or you want to allow swap regardless of the UI limit, set this value to 0.

Return Value

Type: Boolean
True if swap is allowed, false if not.
See Also