Scripting API

PlayerInputManager

class in UnityEngine.InputSystem · Unity.InputSystem · inherits from MonoBehaviour

24 of 24 of Unity's members
In Tassix

Joins local players: instantiates the player prefab (with its PlayerInput) when a device not yet in use presses a button, when the join action triggers, or when a script calls JoinPlayer; announces joins and leaves by message, UnityEvent or C# event.

Fields 2

const string PlayerJoinedMessage
const string PlayerLeftMessage

Properties 14

int fixedNumberOfSplitScreens { get; }
static PlayerInputManager? instance { get; }
InputActionProperty joinAction { get; set; }
PlayerJoinBehavior joinBehavior { get; set; }
bool joiningEnabled { get; }
bool maintainAspectRatioInSplitScreen { get; }
int maxPlayerCount { get; }
PlayerNotifications notificationBehavior { get; set; }
int playerCount { get; }
PlayerJoinedEvent playerJoinedEvent { get; }
PlayerLeftEvent playerLeftEvent { get; }
GameObject? playerPrefab { get; set; }
bool splitScreen { get; set; }
Rect splitScreenArea { get; }

Methods 5

void DisableJoining()
void EnableJoining()
PlayerInput? JoinPlayer(int playerIndex = -1, int splitScreenIndex = -1, string? controlScheme = null, InputDevice? pairWithDevice = null)
PlayerInput? JoinPlayer(int playerIndex, int splitScreenIndex, string? controlScheme, params InputDevice[] pairWithDevices)

A new player: the prefab instantiated, its PlayerInput announced.

void JoinPlayerFromAction(InputAction.CallbackContext context)
void JoinPlayerFromActionIfNotAlreadyJoined(InputAction.CallbackContext context)

Events 2

event Action<PlayerInput>? onPlayerJoined
event Action<PlayerInput>? onPlayerLeft

Checked against Unity

Conformance scenarios that exercise it, recorded in Unity and compared event by event.