fix:1、修复bug。2、删除json表,改为配置加载

This commit is contained in:
barry
2026-06-30 22:15:06 +08:00
parent 1354dfbc34
commit 776d63928d
1086 changed files with 49845 additions and 533285 deletions
+16 -5
View File
@@ -1,6 +1,7 @@
using UnityEngine;
using System.Collections.Generic;
using ChillConnect;
using IgnoreOPS;
public class LevelManager : MonoBehaviour
{
@@ -48,13 +49,13 @@ public class LevelManager : MonoBehaviour
Debug.LogError("关卡ID必须大于0");
return false;
}
if (levelId > 500)
var gameConfigs = ConfigSystem.GetConfig<ArrowGameConfigModel>().DataList;
if (levelId >= gameConfigs.Count)
{
levelId = 500;
levelId = gameConfigs.Count - 1;
}
TextAsset jsonFile = Resources.Load<TextAsset>($"{LevelResourcePath}{levelId}");
var jsonFile = gameConfigs[levelId];
if (jsonFile == null)
{
@@ -62,7 +63,17 @@ public class LevelManager : MonoBehaviour
return false;
}
CurrentLevel = JsonUtility.FromJson<LevelConfig>(jsonFile.text);
var curlevelConfig = new LevelConfig()
{
levelId = jsonFile.id,
levelName = jsonFile.levelName,
gridRows = jsonFile.gridRows,
gridCols = jsonFile.gridCols,
pointSpacing = jsonFile.pointSpacing,
arrows = SerializeUtil.ToObject<List<ArrowConfig>>(jsonFile.arrows)
};
CurrentLevel = curlevelConfig;
if (CurrentLevel == null || CurrentLevel.arrows == null)
{