27 lines
753 B
C#
Raw Normal View History

2024-12-11 20:35:20 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CombatItem : MonoBehaviour
{
[SerializeField] private Image icon;
[SerializeField] private Image mask;
[SerializeField] private Text name;
public SkillState State => _state;
[SerializeField] private SkillState _state;
public void SetData(SkillState s)
{
_state = s;
icon.sprite = AssetBundleManager.ins.Sprite(_state.itemData.Icon, AtlasType.ItemIcon);
}
private void Update()
{
mask.fillAmount = (BattleManager.ins.NowTime - _state.cdTime) / _state.cd *
(1 / (1 + (float)BattleManager.ins.Buff(_state.itemData.Includearms).cd / 10000));
}
}