Guest User

Untitled

a guest
May 16th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. namespace Combat {
  4. public class Health : MonoBehaviour {
  5.  
  6. [SerializeField] float health = 100f;
  7.  
  8. public void TakeDamage(float damage) {
  9.  
  10. health = Mathf.Max(health - damage, 0);
  11. print(health);
  12.  
  13. }
  14.  
  15. }
  16. }
Add Comment
Please, Sign In to add comment