AImageFilled.cs 409 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class AImageFilled : MonoBehaviour
  6. {
  7. private Image image;
  8. private void OnEnable()
  9. {
  10. if (image == null)
  11. image = GetComponent<Image>();
  12. image.fillAmount = 0;
  13. }
  14. private void Update()
  15. {
  16. image.fillAmount += Time.deltaTime;
  17. }
  18. }