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

@@ -19,16 +19,19 @@ public class ProductReceiver : MonoBehaviour
}
//enteredBodies.Add(rb);
if (rb.GetComponent<DefectiveProduct>())
if (rb.TryGetComponent(out Product product))
{
defectiveProductCount++;
}
else
{
normalProductCount++;
}
if (product.Defect != DefectType.None)
{
defectiveProductCount++;
}
else
{
normalProductCount++;
}
Destroy(rb.gameObject);
Destroy(rb.gameObject);
}
}
}