thieumao

GameOverManager - default

Jun 20th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class GameOverManager : MonoBehaviour
  4. {
  5.     public PlayerHealth playerHealth;
  6.  
  7.  
  8.     Animator anim;
  9.  
  10.  
  11.     void Awake()
  12.     {
  13.         anim = GetComponent<Animator>();
  14.     }
  15.  
  16.  
  17.     void Update()
  18.     {
  19.         if (playerHealth.currentHealth <= 0)
  20.         {
  21.             anim.SetTrigger("GameOver");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment