Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Fixed exceptions being thrown by OnScreenStick and improved warnings related to missing UGUI dependencies for current implementations. #1948

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

ekcoh
Copy link
Collaborator

@ekcoh ekcoh commented Jun 13, 2024

Description

CHANGE: Added warning messages to both OnScreenStick and OnScreenButton Inspector editors that would display a warning message in case on-screen control components are added to a GameObject not part of a valid UI hierarchy.
FIX: ISXB-915 OnScreenStick throws System.Exception if added to a GameObject not part of a UGUI object hierarchy.
FIX: ISXB-916 Entering play-mode with a OnScreenStick attached to a non UI hierarchy Game Object floods console with InvalidCastException.

Changes made

See Description. Changes introduced on OnScreenStick and OnScreenButton repectively to respect the fact that base class OnScreenControl is currently agnostic to UI system while OnScreenStick and OnScreenButton currently only support UGUI (UnityEngine.UI).

Notes

Recommend testing with repro steps from linked tickets.

There is also a UX or potential docs perspective to review in how the changes to warning messaged in UI and Console are affected.

Changes require manual verification.

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.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

…ings related to missing UGUI dependencies for current implementations.
@ekcoh
Copy link
Collaborator Author

ekcoh commented Jun 13, 2024

image

Copy link
Collaborator

@ritamerkl ritamerkl left a comment

Choose a reason for hiding this comment

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

Just one minor comment, looks good to me.


internal string GetWarningMessage()
{
return $"{GetType()} needs to be attached as a child to a UI Canvas and have a RectTransform component to function properly.";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: a property would be sufficient (e.g. string warningMessage => $"{GetType()} needs t.....";)

Copy link
Collaborator

@Pauliusd01 Pauliusd01 left a comment

Choose a reason for hiding this comment

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

LGTM. Checked that the warnings are shown correctly/not shown when they're not supposed to and double checked on screen controls functionality on android

@ekcoh ekcoh merged commit f7cc21e into develop Jun 18, 2024
78 of 80 checks passed
@ekcoh ekcoh deleted the isxb-915-isxb-916-fixes branch June 18, 2024 09:27
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.

3 participants