123456789101112131415161718192021222324 |
- using UnityEngine;
- public class GameOverManager : MonoBehaviour
- {
- public PlayerHealth playerHealth;
- Animator anim;
- void Awake()
- {
- anim = GetComponent<Animator>();
- }
- void Update()
- {
- if (playerHealth.currentHealth <= 0)
- {
- anim.SetTrigger("GameOver");
- }
- }
- }
|