Mixedrealitytoolkit-unity: Keyboard/UICollection Broken in Unity 2017.3.1p1

Created on 22 Feb 2018  路  3Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Overview

The top left key in each UICollection is either misplaced or invisible when viewing on the device and building from Unity 2017.3.1p1

Expected Behavior

All keys should be visible and placed how they are in the editor.

Actual Behavior

When I display the keyboard.prefab the Q key is no where to be seen and the &123 is displaced but in view. If I change to other keyboards the same thing happens in that the first element of the UICollection is missing or displaced.

Steps to reproduce

Use Unity 2017.3.1p1 and then instantiate a keyboard.prefab in your scene.

Unity Editor Version

2017.3.1p1

Not reproducable in 2017.2

Mixed Reality Toolkit Release Version

2017.2.1.1 (not certain)

Possible fix:
Add this:

        if (!Application.isEditor) { return; }

To the CollectItems and UpdateLayout methods.

Most helpful comment

I also suffered this bug, solved with the proposed fix.

All 3 comments

I also suffered this bug, solved with the proposed fix.

@markgrossnickle also for me the proposed fix works.
Thank you

From some debugging today, it looks like Unity 2017.3.1p1 had an issue with setting a RectTransform's anchorPosition to (0,0), which line 196 would do for the first buttons in each collection, when Vector2 currentOffset = Vector2.zero;. I checked by adding a small 系 to either x or y, and the issue went away.

The proposed fix above this worked around it, by never calling the update methods. This preserved the layouting from the Editor.

I can't repro this is 2017.4.3f1, so I'm going to mark this as a Unity Bug which has since been fixed. I can't find a public Unity bug though.

Was this page helpful?
0 / 5 - 0 ratings