2024-11-08 18:21:41 +08:00
|
|
|
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)
|
|
|
|
{
|
2024-11-21 09:35:48 +08:00
|
|
|
levelButton._panel = this;
|
2024-11-08 18:21:41 +08:00
|
|
|
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()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|