fix:1、同步ios修复的bug
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user