Building out Golf Level and mission states and improved AI
This commit is contained in:
@@ -138,9 +138,20 @@ public class CarHealth : MonoBehaviour
|
||||
|
||||
Debug.Log($"<b>{gameObject.name}</b> took <color=orange>{amount:F1}</color> damage! Health: {currentHealth:F1}");
|
||||
|
||||
// --- GAME MANAGER HOOKS FOR PLAYER ---
|
||||
if (gameObject.CompareTag("Player") && GameManager.Instance != null)
|
||||
{
|
||||
GameManager.Instance.OnPlayerHit(amount);
|
||||
}
|
||||
|
||||
if (currentHealth <= 0f)
|
||||
{
|
||||
DestroyCar();
|
||||
|
||||
if (gameObject.CompareTag("Player") && GameManager.Instance != null)
|
||||
{
|
||||
GameManager.Instance.GameOver();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user