Mr_Kapitoshka

Untitled

Jun 28th, 2021 (edited)
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using TMPro;
  6.  
  7. public class GameManager : MonoBehaviour
  8. {
  9.  
  10.     public float Money = 999;
  11.     public float Health = 1;
  12.     public float Armor = 0;
  13.     public float Poison = 0;
  14.     public GameObject Heart1;
  15.     public GameObject Heart2;
  16.     public GameObject Heart3;
  17.  
  18.     public Sprite HSH;
  19.     public Sprite SH;
  20.  
  21.     public TextMeshProUGUI coins;
  22.     private Image image;
  23.  
  24.     // Start is called before the first frame update
  25.     void Start()
  26.     {
  27.         image = GetComponent<Image>();
  28.     }
  29.  
  30.     // Update is called once per frame
  31.     void Update()
  32.     {
  33.         coins.text = Money.ToString ();
  34.  
  35.         if(Armor == 1)
  36.         {
  37.             this.gameObject.GetComponent<SpriteRenderer>().sprite = HSH;
  38.         }
  39.     }
  40. }
  41.  
RAW Paste Data