(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

@@ -70,6 +70,7 @@ namespace CameraControl
private void OnDestroy()
{
Program.Instance.OnFocusedDimensionChanged -= Init;
Clock.RemoveTick(this);
}
@@ -81,27 +82,27 @@ namespace CameraControl
/// <param name="obj">当前聚焦的维度对象。</param>
private void Init(Dimension obj)
{
if (!CurrentCamera) // 如果摄像机仍未找到,记录错误并返回
{
Debug.LogError("[CameraControl] 未找到摄像机!摄像机控制功能将无法完全初始化。");
return;
}
Clock.AddTick(this);
// 处理 obj 为 null 的情况 - 此时 dimensionList 已更新
if (!obj)
{
return;
}
if (!CurrentCamera) // 如果摄像机仍未找到,记录错误并返回
{
Debug.LogWarning("[CameraControl] 未找到摄像机!摄像机控制功能将无法完全初始化。");
return;
}
// 根据当前聚焦维度同步 CameraControl 内部的 dimensionId
var focusedIndex = System.Array.IndexOf(dimensionList, obj.name);
var focusedIndex = System.Array.IndexOf(dimensionList, obj.DimensionId);
if (focusedIndex != -1)
{
dimensionId = focusedIndex;
}
else
{
Debug.LogWarning($"[CameraControl] 聚焦维度 '{obj.name}' 未在维度列表中找到。回退到ID 0。");
Debug.LogWarning($"[CameraControl] 聚焦维度 '{obj.DimensionId}' 未在维度列表中找到。回退到ID 0。");
dimensionId = 0; // 找不到时,回退到第一个维度,避免数组越界
}
CurrentCamera.transform.position = new Vector3(obj.cameraPosition.x, obj.cameraPosition.y, -10f);