Skip to content

Conversation

andrew-oc
Copy link
Contributor

Jira
Issue Tracker

Description

This fixes an issue where UI controls would change colour when using MultiplayerEventSystems. The bug was caused by this previous fix (#1443) that attempted to keep user navigation from jumping between different player UIs in local multiplayer games, which worked by making sure all UI controls were inside CanvasGroup controls, one for each player UI, and toggling the CanvasGroup interactable property between true and false, depending on what UI was currently updating. Unfortunately toggling the interactable property makes all child UI controls animate between active and disabled states, which changes their colour when transitions have been set.

Changes made

This fix moves the logic to keep navigation inside a players UI to the InputSystemUIInputModule component, and reverts the previous CanvasGroup related changes to MultiplayerEventSystem. A 'localMultiPlayerRoot' property has been added that can be set when running a local multiplayer game and when executing the Move action, we first speculatively perform the navigation and disallow that move (don't execute the move event) if the target Selectable is outside the player root.

Notes

With this change, InputSystemUIInputModule takes a reference to UnityEngine.UI, which I think should be ok.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@andrew-oc andrew-oc requested a review from jamesmcgill June 10, 2022 12:59
Copy link
Collaborator

@jamesmcgill jamesmcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants