mirror of
https://github.com/nothke/quality-control.git
synced 2024-11-12 22:03:42 +00:00
31 lines
716 B
C#
31 lines
716 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ProductReceiver : MonoBehaviour
|
|
{
|
|
///HashSet<Rigidbody> enteredBodies = new HashSet<Rigidbody>();
|
|
|
|
public int normalProductCount;
|
|
public int defectiveProductCount;
|
|
|
|
private void OnTriggerEnter(Collider otherCollider)
|
|
{
|
|
var product = otherCollider.GetComponentInParent<Product>();
|
|
|
|
if (product != null)
|
|
{
|
|
if (product.Defect != DefectType.None)
|
|
{
|
|
defectiveProductCount++;
|
|
}
|
|
else
|
|
{
|
|
normalProductCount++;
|
|
}
|
|
|
|
Destroy(product.gameObject);
|
|
}
|
|
}
|
|
}
|