(client) feat:添加基地界面到游玩界面的过程,添加存档管理,技能树变得可用 (#58)

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/58
This commit is contained in:
2025-10-03 00:31:34 +08:00
parent aff747be17
commit dd9d90439d
134 changed files with 10322 additions and 4872 deletions

View File

@@ -0,0 +1,62 @@
using System.Linq;
using Base;
using Data;
using Managers;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UI
{
public class SkillTreeNodeInformationUI:UIBase
{
public TMP_Text label;
public TMP_Text description;
public TMP_Text coin;
public Button purchaseButton;
public SkillTreeNodeUI currentLink;
public SkillTreeDef SkillTreeDef => currentLink.SkillTreeDefine;
public bool CanUnlock
{
get
{
if (SkillTreeDef.cost > Program.Instance.CoinCount)
return false;
var parent = SkillTreeManager.Instance.GetAllDirectParents(SkillTreeDef);
return parent.All(p => SkillTreeManager.Instance.IsSkillTreeUnlocked(p.defName));
}
}
public void Init(SkillTreeNodeUI nodeUI)
{
currentLink = nodeUI;
label.text = SkillTreeDef.label;
description.text = SkillTreeDef.description;
coin.text = $"{SkillTreeDef.cost}/{Program.Instance.CoinCount}";
if (CanUnlock)
{
coin.color = Color.white;
purchaseButton.interactable = true;
}
else
{
coin.color = Color.red;
purchaseButton.interactable = false;
}
}
public void Purchase()
{
SkillTreeManager.Instance.UnlockSkillTree(SkillTreeDef.defName);
OnHide();
currentLink.Refresh();
}
public void OnHide()
{
UIInputControl.Instance.Hide(this);
}
}
}