_xiaofang/xiaofang/Assets/Script/scheduled_excercise/LoadScene.cs
2024-12-28 21:42:16 +08:00

39 lines
1.1 KiB
C#

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;
public GameObject templatePrefab;
public Transform temlateContent;
public getTemplateList getTemplaste;
// Start is called before the first frame update
void Start()
{
nextBtn.onClick.AddListener(OnClickNextBtn);
yesBtn.onClick.AddListener(OnClickYesBtn);
}
private async void OnClickYesBtn()
{
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>();
}
SceneManager.LoadScene(2);
}
public void OnClickNextBtn()
{
SceneManager.LoadScene("Schedule_03");
}
}