CakeMeister

2d shooter spikes phan 4

Jul 25th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class spikes : MonoBehaviour {
  6.  
  7.     public float health = 100;
  8.  
  9.     private void FixedUpdate()
  10.     {
  11.         if (health <= 0)
  12.             gameObject.SetActive(false);
  13.        
  14.     }
  15.     void Damage(int dmg)
  16.     {
  17.         health -= dmg;
  18.     }
  19.    
  20. }
Add Comment
Please, Sign In to add comment