OldBlueWater/BlueWater/Assets/02.Scripts/Ui/SkillUi.cs
NTG 498162d4a8 TimeScale 기능 VisualFeedbackManager로 이동
+ 전투 맵 수정
+ CombatPlayer MainSkillUi 초기화 오류 수정
+ 메뉴UI Close버튼 미작동 수정
+ HitStop과 SlowMotion 겹치는 문제 수정
2024-05-13 16:21:45 +09:00

54 lines
1.4 KiB
C#

using System;
using System.Collections;
using Doozy.Runtime.UIManager.Containers;
using UnityEngine;
using UnityEngine.UI;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
[Serializable]
public class SkillUi : MonoBehaviour
{
[field: SerializeField] public GameObject Obj { get; set; }
[field: SerializeField] public Image Icon { get; set; }
[field: SerializeField] public Image Fill { get; set; }
[field: SerializeField] public UIView Fade { get; set; }
private Coroutine cooldownCoroutine;
private void Start()
{
Fill.fillAmount = 0f;
}
public void Cooldown(float waitTime)
{
cooldownCoroutine = StartCoroutine(CooldownCoroutine(waitTime));
}
private IEnumerator CooldownCoroutine(float waitTime)
{
Fill.fillAmount = 1f;
while (Fill.fillAmount > 0f)
{
Fill.fillAmount -= Time.deltaTime / waitTime;
yield return null;
}
Fade.Show();
}
public void ResetSkillUi()
{
if (cooldownCoroutine != null)
{
StopCoroutine(cooldownCoroutine);
cooldownCoroutine = null;
}
Fill.fillAmount = 0f;
}
}
}