1
0
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:
2026-03-16 12:04:03 +02:00
parent db60947749
commit 2c8c146a5f
6 changed files with 16 additions and 13 deletions

View File

@@ -40,9 +40,10 @@ public class ShapeScannerRay : MonoBehaviour
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == scannableTag)
if (other.gameObject.CompareTag(scannableTag))
{
collidingObjects.Add(other.gameObject);
GameObject parent = other.transform.parent.gameObject;
collidingObjects.Add(parent);
// Only activate when this was the first object that entered collision
if (collidingObjects.Count == 1)
{
@@ -64,9 +65,10 @@ public class ShapeScannerRay : MonoBehaviour
private void OnTriggerExit(Collider other)
{
if (other.gameObject.tag == "ShapeScannable")
if (other.gameObject.CompareTag(scannableTag))
{
collidingObjects.Remove(other.gameObject);
GameObject parent = other.transform.parent.gameObject;
collidingObjects.Remove(parent);
if (collidingObjects.Count == 0)
{
foreach (MeshRenderer meshRenderer in meshRenderers)