quality-control/Assets/Scripts/Machines/ProductReceiver.cs
2024-08-18 18:42:01 +02:00

24 lines
568 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)
{
Scoreboard.Instance.ScoreProduct(product);
Destroy(product.gameObject);
}
}
}