Assets\Health.cs(43,21): error CS0119: ‘GameObject’ is a type, which is not valid in the given context
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Health : MonoBehaviour
{
public int health;
public int numOfHearts;
public Image[] hearts;
public Sprite fullHeart;
public Sprite emptyHeart;
void Update(){
if (health > numOfHearts)
{
health = numOfHearts;
}
for (int i = 0; i < hearts.Length; i++)
{
if (i < health)
{
hearts*.sprite = fullHeart;*
}
else
{
hearts*.sprite = emptyHeart;*
}
if (i < numOfHearts)
{
hearts*.enabled = true;*
}
else
{
hearts*.enabled = false;*
}
}
if (health < 1)
{
Destroy(GameObject);
}
}
}