using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Damage : MonoBehaviour
{
public float hp = 100f;
public Text.text TextHP;
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Damage")
{
hp -= 20f;
TextHP = hp;
if (hp <= 1f)
{
Death();
}
}
}
private void Death()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}
Текст ошибки:Assets\Scripts\Damage.cs(10,17): error CS0426: The type name 'text' does not exist in the type 'Text'