WXGame/box1/Assets/Script/UI/LevelPanel.cs
2024-11-21 09:35:48 +08:00

44 lines
931 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LevelPanel : MonoBehaviour
{
private int levelID;
[SerializeField] private List<LevelButton> tourObjects;
public void StartPanel(int id)
{
levelID = id;
if (id==0)
{
id = 11001;
}
// var bo=DataManager.LevelOpen(id);
var levelData = JsonTab.Instance.tables.Chapter.Get(id);
foreach (var levelButton in tourObjects)
{
levelButton._panel = this;
levelButton.Reset();
}
int index = 0;
foreach (var data in levelData.Contain)
{
tourObjects[index].SetLevelData(data);
index++;
}
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}