mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-31 23:53:44 +00:00
Assembling Main scene.
This commit is contained in:
@@ -9,18 +9,11 @@ public class ProductReceiver : MonoBehaviour
|
||||
public int normalProductCount;
|
||||
public int defectiveProductCount;
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
private void OnTriggerEnter(Collider otherCollider)
|
||||
{
|
||||
var rb = collision.rigidbody;
|
||||
var product = otherCollider.GetComponentInParent<Product>();
|
||||
|
||||
if (!rb)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//enteredBodies.Add(rb);
|
||||
|
||||
if (rb.TryGetComponent(out Product product))
|
||||
if (product != null)
|
||||
{
|
||||
if (product.Defect != DefectType.None)
|
||||
{
|
||||
@@ -31,7 +24,7 @@ public class ProductReceiver : MonoBehaviour
|
||||
normalProductCount++;
|
||||
}
|
||||
|
||||
Destroy(rb.gameObject);
|
||||
Destroy(product.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user