Unity-Technologies / InputSystem

An efficient and versatile input system for Unity.
Other
1.42k stars 306 forks source link

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

Closed ekcoh closed 2 months ago

ekcoh commented 2 months ago

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:

During merge:

After merge:

ekcoh commented 2 months ago

image