(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,83 @@
using System;
using System.Collections.Generic;
using Data;
using Managers;
using UnityEngine;
namespace UI
{
public class StartPlayUI:FullScreenUI
{
public Transform iconList;
private int _currentIndex;
public int CurrentDimensionIndex
{
get => _currentIndex;
set
{
_currentIndex = value;
if (_currentIndex < 0)
{
_currentIndex += mapViewUIList.Count;
}
else if (_currentIndex >= mapViewUIList.Count)
{
_currentIndex %= mapViewUIList.Count;
}
}
}
public DimensionDef CurrentDimension => mapViewUIList[CurrentDimensionIndex].DimensionDefine;
public MapViewUI mapViewUIPrefab;
public List<MapViewUI> mapViewUIList = new List<MapViewUI>();
private void Start()
{
var dimensionDefs = DefineManager.Instance.QueryDefinesByType<DimensionDef>();
if(dimensionDefs==null)
return;
foreach (var d in dimensionDefs)
{
if(!d.canSelect)
continue;
var newObj=Instantiate(mapViewUIPrefab,iconList);
mapViewUIList.Add(newObj);
newObj.Init(d);
newObj.gameObject.SetActive(false);
newObj.transform.localPosition = Vector3.zero;
}
UpdateUI();
}
public void UpdateUI()
{
if (mapViewUIList == null)
return;
for (var i = 0; i < mapViewUIList.Count; i++)
{
mapViewUIList[i].gameObject.SetActive(i == CurrentDimensionIndex);
}
}
public void OnStartGame()
{
Program.Instance.StartPlayGame(CurrentDimension);
}
public void OnLeft()
{
CurrentDimensionIndex-=1;
UpdateUI();
}
public void OnRight()
{
CurrentDimensionIndex+=1;
UpdateUI();
}
}
}