forked from cgvr/DeltaVR
fixed bug with shape scanner destroying not whole scannable object, deleted Parent-GeneratedModel objects from scene
This commit is contained in:
@@ -131,7 +131,7 @@ public class ShapeScanner : MonoBehaviour
|
||||
UpdateDisplay(percentage);
|
||||
}
|
||||
|
||||
private void OnConfigurationComplete()
|
||||
private async void OnConfigurationComplete()
|
||||
{
|
||||
// Destroy colliding scannable objects
|
||||
HashSet<GameObject> allCollidingObjects = new();
|
||||
@@ -145,17 +145,19 @@ public class ShapeScanner : MonoBehaviour
|
||||
var grab = collidingObject.GetComponent<XRGrabInteractable>();
|
||||
if (grab != null && grab.isSelected)
|
||||
{
|
||||
var interactor = grab.firstInteractorSelecting; // the hand/controller currently holding it
|
||||
if (interactor != null)
|
||||
var interactors = new List<IXRSelectInteractor>(grab.interactorsSelecting); // the controllers currently holding it
|
||||
foreach (var interactor in interactors)
|
||||
{
|
||||
// Transfer ownership: tell the manager to stop the selection
|
||||
interactionManager.SelectExit(interactor, grab);
|
||||
grab.enabled = false;
|
||||
}
|
||||
}
|
||||
collidingObject.transform.position = Vector3.zero;
|
||||
Destroy(collidingObject);
|
||||
}
|
||||
|
||||
await Task.Delay(100);
|
||||
// Destroy all existing rays
|
||||
foreach (ShapeScannerRay ray in existingRays)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user