microsoft / MixedRealityDesignLabs_Unity

Mixed Reality Design Labs share experimental samples, explorations and learning from Windows Mixed Reality Design group. If you are looking for official toolkit, please use Mixed Reality Toolkit
MIT License
408 stars 110 forks source link

CS0649 warnings and crash on selecting item with Bounding Box #69

Closed ghost closed 7 years ago

ghost commented 7 years ago

When I clone and build the projects, I get a crash in BoundingBoxManupulate::TargetScale, because the field scaleTransform is null, even in the demo project. Checking the Unity console I can see this is one of many warnings where a serialised private field is never assigned (CS0649). It looks like I'm missing some serialised objects to initialise the instance. I'm using Unity 2017.1.0f3 personal. I've checked the installation instructions many times but am still seeing this.

andy3hg commented 7 years ago

have u figure out the problem? I got stuck with this same problem for one week.

paseb commented 7 years ago

It's an issue with a race condition and not properly null checking variables. Change line 246 in BoundingBoxManipulate.cs to:

return scaleTransform != null ? scaleTransform.localScale : Vector3.one;

I'll have the fix added to the main tools repo and update the submodules in the subsequent repos.

-thanks, pat

paseb commented 7 years ago

This has been fixed in the latest rev.