Assembling Main scene.

This commit is contained in:
Khauvinkh
2024-08-18 17:48:35 +02:00
parent 409876fd7b
commit a2584d9640
45 changed files with 3692 additions and 115 deletions

View File

@@ -10,8 +10,10 @@ public class Converter: MonoBehaviour
public Transform outputPoint;
public ProductType conversionProduct;
public bool isBroken;
public float conversionTime = 5f;
public int CurrentHealth;
public int MaxHealth;
public float conversionDuration = 5f;
private float _conversionTimer;
public Transform refuseLauncher;
@@ -28,9 +30,15 @@ public class Converter: MonoBehaviour
}
}
public void Start()
{
_conversionTimer = conversionDuration;
CurrentHealth = MaxHealth;
}
public void Update()
{
if (isBroken)
if (CurrentHealth <= 0)
{
return;
}
@@ -56,7 +64,7 @@ public class Converter: MonoBehaviour
inputProducts.RemoveAt(0);
}
_conversionTimer = conversionTime;
_conversionTimer = conversionDuration;
}
_conversionTimer -= Time.deltaTime;