Added defect detector prefab.

This commit is contained in:
Khauvinkh committed 2024-08-17 21:07:25 +02:00
1 parent ece1afe008
commit ae76789a51
7 files changed
+534 -2

No files matched your search

@@ -17,14 +17,14 @@ public class ProductDescription : ScriptableObject
public GameObject GetRandomProduct()
{
float randomValue = Random.value;
float randomValue = Random.Range(0, 100);
float sum = 0;
for (var i = 0; i < Products.Length; i++)
{
var product = Products[i];
sum += product.Probability / 100f;
sum += product.Probability;
if (randomValue <= sum)
{
return product.Prefab;