Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using TMPro;
- public class GameManager : MonoBehaviour
- {
- public float Money = 999;
- public float Health = 1;
- public float Armor = 0;
- public float Poison = 0;
- public GameObject Heart1;
- public GameObject Heart2;
- public GameObject Heart3;
- public Sprite HSH;
- public Sprite SH;
- public TextMeshProUGUI coins;
- private Image image;
- // Start is called before the first frame update
- void Start()
- {
- image = GetComponent<Image>();
- }
- // Update is called once per frame
- void Update()
- {
- coins.text = Money.ToString ();
- if(Armor == 1)
- {
- this.gameObject.GetComponent<SpriteRenderer>().sprite = HSH;
- }
- }
- }
Add Comment
Please, Sign In to add comment