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

Disabling Bounding Box Target #63

Closed HattMarris1 closed 6 years ago

HattMarris1 commented 7 years ago

When Bounding Box target is disabled, the Bounding box still moves around it, and the AppBar still appears.

What I'm looking to achieve is to have a "Lock" button, which disables the bounding box for a given object, so other controls on the object can be used.

HattMarris1 commented 7 years ago

I'm assuming from the enhancement tag there's no way to do this currently?

Railboy commented 7 years ago

Correct, that's something you would currently have to add.

HattMarris1 commented 7 years ago

Would a pull request for this be appreciated? I was going to add an extra default button ("lock") that disables the "scale" child GameObject on the bounding box.

Railboy commented 7 years ago

Absolutely!

Tanja-L commented 6 years ago

Disabling bounding box target doesn't take any effect. It took me a few hours to figure out a solution to disable and enable the bounding box via script. When the application is running the script creates a new Game Object called BoundingBoxShell(Clone) which has a BoundingBoxManipulate script that holds a target property. Find the BoundingBoxShell(Clone) and the BoundingBoxManipulate script component. Then set the target to null to disable the bounding box. To enable the box, assign the Transform of the GameObject that you want to scale and rotate to the target property of BoundingBoxManipulate. I haven't tested it for multiple game objects and bounding boxes , but it works well if you only have one main object collection with a bounding box in your scene.

HattMarris1 commented 6 years ago

Thanks for the response @Tanja-L, I might be misunderstanding you here, but surely the boundingbox just retargets the object as soon as you tap on it again?

What I'm looking to achieve is to allow the user to interact with ui elements on the object itself, and what I've found is that the boundingbox's collider is in the way.

HattMarris1 commented 6 years ago

My solution to this was to create another boundingbox in which I could disable the collider

Tanja-L commented 6 years ago

You are right. I forgot to mention that I also disable the main collider around my object collection, so the bounding box doesn't reactivate itself and interaction with the child objects is possible.