docs.unity.cn
    Show / Hide Table of Contents

    Enum PlayerJoinBehavior

    Determines how PlayerInputManager joins new players.

    Namespace: UnityEngine.InputSystem
    Syntax
    public enum PlayerJoinBehavior

    Fields

    Name Description Value
    JoinPlayersWhenButtonIsPressed

    Listen for button presses on devices that are not paired to any player. If they occur and joining is allowed, join a new player using the device the button was pressed on.


    0
    JoinPlayersWhenJoinActionIsTriggered
    1
    JoinPlayersManually

    Do not join players automatically. Call UnityEngine.InputSystem.PlayerInputManager.JoinPlayerFromUI or JoinPlayerFromAction(InputAction.CallbackContext) explicitly in order to join new players. Alternatively, just create GameObjects with PlayerInput components directly and they will be joined automatically.


    This behavior also allows implementing more sophisticated device pairing mechanisms when multiple devices are involved. While initial engagement required by JoinPlayersWhenButtonIsPressed or JoinPlayersWhenJoinActionIsTriggered allows pairing a single device reliably to a player, additional devices that may be required by a control scheme will still get paired automatically out of the pool of available devices. This means that, for example, if a given player joins by clicking a mouse button ...

    2
    See Also
    PlayerInputManager
    joinBehavior
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Tuesday, August 15, 2023