Advertisement
AmbiensVR

MainMenu

Aug 5th, 2020
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. public class MainMenu : MonoBehaviour
  6. {
  7.     public string otherSceneName = "";
  8.     public ArchToolkit.Settings.ArchSettings settings;
  9.     public Loader loader;
  10.     private AsyncOperation operation;
  11.     public void OpenScene360()
  12.     {
  13.         settings.ExitCallbackOverride = this.GoBack;
  14.         settings.movementTypePerPlatform = ArchToolkit.MovementTypePerPlatform.FullScreen360;
  15.         this.loader.ShowLoader();
  16.         this.operation=SceneManager.LoadSceneAsync(otherSceneName, LoadSceneMode.Single);
  17.         this.operation.allowSceneActivation = true;
  18.     }
  19.     public void OpenSceneVR()
  20.     {
  21.         settings.ExitCallbackOverride = this.GoBack;
  22.         settings.movementTypePerPlatform = ArchToolkit.MovementTypePerPlatform.VR;
  23.         this.loader.ShowLoader();
  24.         this.operation = SceneManager.LoadSceneAsync(otherSceneName, LoadSceneMode.Single);
  25.         this.operation.allowSceneActivation = true;
  26.     }
  27.     private void Update()
  28.     {
  29.         if (this.operation != null)
  30.         {
  31.             this.loader.SetValue(this.operation.progress);
  32.         }
  33.     }
  34.     public void GoBack()
  35.     {
  36.         SceneManager.LoadScene("Intro");
  37.     }
  38.     public void Exit()
  39.     {
  40.         Application.Quit();
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement