microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

`PressableButtonHoloLens2Toggle_32x96_Dwell` does not change off-color #11365

Closed turbotimon closed 9 months ago

turbotimon commented 1 year ago

Describe the bug

The Toggle-Button does not change color as set when toggled. (The function ButtonExecute in ToggleDwellPressableButton.cs is never executed.)

To reproduce

Steps to reproduce the behavior:

  1. Add a PressableButtonHoloLens2Toggle_32x96_Dwell to your scene
  2. Change dwellOffColor to e.g. red
  3. Go to play mode and toggle the button
  4. See that color doesn't get changed (well it does, but not to the color set, e.g. red)

Expected behavior

Color gets changed

Screenshots

image

Your setup (please complete the following information)

Target platform (please complete the following information)

Additional context

These code in ToggleDwellPressableButton.cs is never executed:

        /// <inheritdoc/>
        public override void ButtonExecute()
        {
            Debug.Log($"ButtonExecute {isDwellEnabled}"); // DEBUG test, to see it is never executed
            isDwellEnabled = !isDwellEnabled;
            dwellStatus.text = isDwellEnabled ? "On" : "Off";

            // swap the button background and dwell visuals overlay color
            buttonBackground.material.color = isDwellEnabled ? this.dwellOnColor : this.dwellOffColor;
            dwellVisualImage.material.color = isDwellEnabled ? this.dwellOffColor : this.dwellOnColor;
        }
turbotimon commented 1 year ago

in addition: the field bool isDwellEnabled is logically rather a isToggled or not?

AMollis commented 1 year ago

Seems related to #11367

@marlenaklein-msft can you check if this is reproducible in MRTK3

IssueSyncBot commented 9 months ago

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!