(client) feat:健康给予,路径优化,结算界面,商店界面 (#60)

Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com>
Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/60
This commit is contained in:
2025-10-10 14:08:23 +08:00
parent 9a797479ff
commit 16b49f3d3a
1900 changed files with 114053 additions and 34157 deletions

View File

@@ -0,0 +1,41 @@
using System.Linq;
using Data;
using Entity;
using Managers;
using UnityEngine;
using Random = UnityEngine.Random;
namespace UI
{
public class ShopCardUIBuff : ShopCardUI
{
private HediffDef hediffDef;
public override void Init()
{
var hediffList = DefineManager.Instance.QueryDefinesByType<HediffDef>();
if (!hediffList.Any())
return;
var index = Random.Range(0, hediffList.Length);
Init(hediffList[index]);
}
public void Init(HediffDef def)
{
if (def.textures is { Length: > 0 })
icon.sprite = PackagesImageManager.Instance.GetSprite(def.textures[0]);
SetLabel(def.label);
description.text = def.description;
hediffDef = def;
}
public override void OnEnter()
{
base.OnEnter();
if (Program.Instance.FocusedEntity is LivingEntity livingEntity)
{
livingEntity.AddHediff(new Hediff(hediffDef));
}
}
}
}