(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

@@ -1,17 +1,51 @@
using System;
using Data;
using Managers;
using Prefab;
using UnityEngine;
using UnityEngine.UI;
namespace UI
{
public class AttackModeUI:MonoBehaviour
public class AttackModeUI : MonoBehaviour
{
public UIImageAnimator icon;
public int CurrentIndex { get; private set; }
public RobotLogicDef[] robotLogic;
public RobotLogicDef CurrentLogic => robotLogic?[CurrentIndex];
private void Start()
{
icon.gameObject.SetActive(false);
robotLogic=Program.Instance.CurrentCharacter?.robotLogic;
if (robotLogic == null || robotLogic.Length == 0)
{
robotLogic= Array.Empty<RobotLogicDef>();
icon.gameObject.SetActive(false);
return;
}
UpdateUI();
}
public void UpdateUI()
{
if (CurrentLogic == null)
return;
icon.SetSprites(PackagesImageManager.Instance.GetSprites(new[]
{
CurrentLogic.icon
}));
Program.Instance.CurrentRobotLogic = CurrentLogic;
}
public void OnSwitch()
{
if (robotLogic.Length == 0)
return;
CurrentIndex += 1;
CurrentIndex %= robotLogic.Length;
UpdateUI();
}
}
}