mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 05:27:13 +08:00
(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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user