Chataigne/Assets/Script/Life.cs
Djalim Simaila 36a2982a48 IMPORTATION_CODE
Code parralax des décors
Ajout et correction du code Hadès
2023-05-30 20:24:37 +02:00

28 lines
576 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Life : MonoBehaviour
{
public int heartNumber;
private GameObject player;
private Player p;
private Image image;
void Start(){
player = GameObject.Find("Player");
p = player.GetComponent<Player>();
image = GetComponent<Image>();
}
private void Update()
{
if (p.health >= heartNumber){
image.enabled = true;
}
else{
image.enabled = false;
}
}
}