Reworking item spawn, adding item conversion.

This commit is contained in:
Khauvinkh
2024-08-18 14:44:44 +02:00
parent d2c3dff101
commit 683f839905
50 changed files with 2219 additions and 766 deletions

View File

@@ -24,14 +24,16 @@ public class TrashBin : MonoBehaviour
public void OnTriggerEnter(Collider otherCollider)
{
var rb = otherCollider.GetComponent<Rigidbody>();
var rb = otherCollider.GetComponentInParent<Rigidbody>();
if (!rb)
{
return;
}
if (otherCollider.TryGetComponent(out Product product))
var product = otherCollider.GetComponentInParent<Product>();
if (product)
{
if (!enteredProducts.Contains(product))
{
@@ -45,7 +47,9 @@ public class TrashBin : MonoBehaviour
public void OnTriggerExit(Collider collider)
{
if (collider.TryGetComponent(out Product product))
var product = collider.GetComponentInParent<Product>();
if (product)
{
if (enteredProducts.Contains(product))
{