2020-02-20 12:29:15 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
|
|
|
|
public class ChangeScene : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
2020-04-29 21:04:48 +00:00
|
|
|
|
if(SceneManager.GetActiveScene().buildIndex == 1)
|
|
|
|
|
{
|
|
|
|
|
StartCoroutine(ChangeSceneToGame(2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(SceneManager.GetActiveScene().buildIndex == 3)
|
|
|
|
|
{
|
|
|
|
|
StartCoroutine(ChangeSceneToGame(0));
|
|
|
|
|
}
|
2020-02-20 12:29:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-29 21:04:48 +00:00
|
|
|
|
private IEnumerator ChangeSceneToGame(int index)
|
2020-02-20 12:29:15 +00:00
|
|
|
|
{
|
|
|
|
|
yield return new WaitForSeconds(5);
|
2020-04-29 21:04:48 +00:00
|
|
|
|
SceneManager.LoadScene(index);
|
2020-02-20 12:29:15 +00:00
|
|
|
|
}
|
|
|
|
|
}
|