Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment