Advertisement
kadyr

Untitled

Jun 27th, 2021
941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class PlayerController : MonoBehaviour
  7. {
  8.     int hp = 3;
  9.     [SerializeField] Text hpText;
  10.     void Start()
  11.     {
  12.         ChHP(-1);    
  13.     }
  14.     public void ChHP(int healthChangeValue)//Change Heath Point Method
  15.     {
  16.         hp += healthChangeValue;
  17.         hpText.text = hp.ToString();
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement