Advertisement
CakeMeister

BOX phan 10

Jul 3rd, 2017
893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class BOX1 : MonoBehaviour {
  6.     public int Health = 100;
  7.    
  8.     // Update is called once per frame
  9.     void Update () {
  10.         if (Health <= 0)
  11.         {
  12.             Destroy(gameObject);
  13.         }
  14.     }
  15.  
  16.     void Damage(int damage)
  17.     {
  18.         Health -= damage;
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement