_xiaofang/xiaofang/Assets/Script/scheduled_excercise/LoadScene.cs

38 lines
1.0 KiB
C#
Raw Normal View History

2024-11-25 16:33:54 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class LoadScene : MonoBehaviour
{
public Button nextBtn;
public Button yesBtn;
2024-12-11 15:32:27 +08:00
public GameObject templatePrefab;
public Transform temlateContent;
public getTemplateList getTemplaste;
2024-11-25 16:33:54 +08:00
// Start is called before the first frame update
void Start()
{
nextBtn.onClick.AddListener(OnClickNextBtn);
yesBtn.onClick.AddListener(OnClickYesBtn);
}
2024-12-11 15:32:27 +08:00
private async void OnClickYesBtn()
2024-11-25 16:33:54 +08:00
{
2024-12-11 15:32:27 +08:00
TemplateListData templateListData = await getTemplaste.TemplaRst();
foreach (var info in templateListData.data)
{
Debug.Log("+++++++++++>>>>>>>>>>>>>>>>"+info);
GameObject template=GameObject.Instantiate(templatePrefab, temlateContent);
TemplateInfo templateInfo = template.GetComponent<TemplateInfo>();
}
2024-11-25 16:33:54 +08:00
}
public void OnClickNextBtn()
{
2024-12-11 15:32:27 +08:00
SceneManager.LoadScene(2);
2024-11-25 16:33:54 +08:00
}
}