docs.unity3d.com
    Show / Hide Table of Contents

    Class MultiplayerEventSystem

    A modified EventSystem class, which allows multiple players to have their own instances of a UI, each with it's own selection.

    Inheritance
    Object
    MultiplayerEventSystem
    Namespace: UnityEngine.InputSystem.UI
    Syntax
    public class MultiplayerEventSystem : EventSystem
    Remarks

    You can use the playerRoot property to specify a part of the hierarchy belonging to the current player. Mouse selection will ignore any game objects not within this hierarchy. For gamepad/keyboard selection, you need to make sure that the navigation links stay within the player's hierarchy.

    Properties

    playerRoot

    The root object of the UI hierarchy that belongs to the given player.

    Declaration
    public GameObject playerRoot { get; set; }
    Property Value
    Type Description
    GameObject
    Remarks

    This can either be an entire Canvas or just part of the hierarchy of a specific Canvas.

    Note that if the given GameObject has a CanvasGroup component on it, its interactable property will be toggled back and forth by MultiplayerEventSystem. If no such component exists on the GameObject, one will be added automatically.

    Only the CanvasGroup corresponding to the MultiplayerEventSystem that is currently executing its Update() method (or did so last) will have interactable set to true. In other words, only the UI hierarchy corresponding to the player that is currently running a UI update (or that did so last) can be interacted with.

    Methods

    OnDisable()

    Declaration
    protected override void OnDisable()

    OnEnable()

    Declaration
    protected override void OnEnable()

    Update()

    Declaration
    protected override void Update()
    In This Article
    • Properties
      • playerRoot
    • Methods
      • OnDisable()
      • OnEnable()
      • Update()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023