Files
bansonic_beta_main/Assets/scripts/Songs_Select/back_toPreviousPage.cs
T

42 lines
961 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class back_toPreviousPage : MonoBehaviour
{
public string scene_turn_to_previous_scene = "selectYourSongFirst";
[Header("homepage")]
public string homePage_sceneName_to_turn = "Main_main";
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void backto_PreviousPage()
{
StartCoroutine(LoadSceneAsync(scene_turn_to_previous_scene));
}
public void backto_homePage()
{
StartCoroutine(LoadSceneAsync(homePage_sceneName_to_turn));
}
private IEnumerator LoadSceneAsync(string sceneName)
{
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneName);
while (!asyncLoad.isDone)
{
yield return null;
}
}
}