2024-08-17 13:12:00 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class ProductReceiver : MonoBehaviour
|
2024-08-18 20:01:15 +00:00
|
|
|
{
|
2024-08-18 15:48:35 +00:00
|
|
|
private void OnTriggerEnter(Collider otherCollider)
|
2024-08-17 13:12:00 +00:00
|
|
|
{
|
2024-08-18 15:48:35 +00:00
|
|
|
var product = otherCollider.GetComponentInParent<Product>();
|
2024-08-17 13:12:00 +00:00
|
|
|
|
2024-08-18 15:48:35 +00:00
|
|
|
if (product != null)
|
2024-08-17 13:12:00 +00:00
|
|
|
{
|
2024-08-18 16:42:01 +00:00
|
|
|
Scoreboard.Instance.ScoreProduct(product);
|
2024-08-17 13:12:00 +00:00
|
|
|
|
2024-08-18 15:48:35 +00:00
|
|
|
Destroy(product.gameObject);
|
2024-08-18 12:44:44 +00:00
|
|
|
}
|
2024-08-17 13:12:00 +00:00
|
|
|
}
|
|
|
|
}
|