using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Shield : MonoBehaviour
{
public float cooldown;
[HideInInspector]public bool isCooldown;
private Image shieldImage;
private Player player;
void Start()
{
shieldImage = GetComponent<Image>();
player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
isCooldown = true;
}
void Update()
{
if (isCooldown)
{
shieldImage.fillAmonunt -= 1 / cooldown * Time.deltaTime;
if(shieldImage.fillAmonunt < 0)
{
shieldImage.fillAmonunt = 1;
isCooldown = false;
player.shield.SetActive(false);
gameObject.SetActive(false);
}
}
}
public void Resettimer()
{
shieldImage.fillAmonunt = 1;
}
}
Сама ошибка:
Assets\Sripts\Shield.cs(26,24): error CS1061: ‘Image’ does not contain a definition for ‘fillAmonunt’ and no accessible extension method ‘fillAmonunt’ accepting a first argument of type ‘Image’ could be found (are you missing a using directive or an assembly reference?)