Youtube Video
Scripts used in this Video:
Code used in the loading screen:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class loadingmanager : MonoBehaviour {
void Start()
{
StartCoroutine (loadingprocess());
}
IEnumerator loadingprocess()
{
yield return new WaitForSeconds (1f);
SceneManager.LoadScene (1);
}
}
Code used in the Menu for button:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class menumanagerscript : MonoBehaviour {
public void GameStart()
{
SceneManager.LoadScene (2);
}
public void EndGame()
{
Application.Quit ();
}
}
Make sure that you have the class name matched to make it work. Thank u for visiting.
No comments:
Post a Comment