2025-10-10 14:08:23 +08:00
|
|
|
using Entity;
|
|
|
|
|
using Managers;
|
2025-09-03 19:59:22 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Prefab
|
|
|
|
|
{
|
2025-10-10 14:08:23 +08:00
|
|
|
public class BuffIconUI : MonoBehaviour
|
2025-09-03 19:59:22 +08:00
|
|
|
{
|
|
|
|
|
public UIImageAnimator icon;
|
2025-10-10 14:08:23 +08:00
|
|
|
|
|
|
|
|
public void Init(Hediff hediff)
|
|
|
|
|
{
|
|
|
|
|
var stage = hediff.CurrentStage;
|
|
|
|
|
if (stage is { textures: { Length: > 0 } })
|
|
|
|
|
{
|
|
|
|
|
if (stage.textures == null) return;
|
|
|
|
|
var sprites = PackagesImageManager.Instance.GetSprites(stage.textures);
|
|
|
|
|
icon.SetSprites(sprites);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (hediff.def.textures == null) return;
|
|
|
|
|
var sprites = PackagesImageManager.Instance.GetSprites(hediff.def.textures);
|
|
|
|
|
icon.SetSprites(sprites);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-03 19:59:22 +08:00
|
|
|
}
|
|
|
|
|
}
|