-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevelLoader.cs
More file actions
86 lines (74 loc) · 1.97 KB
/
LevelLoader.cs
File metadata and controls
86 lines (74 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
public class LevelLoader : MonoBehaviour
{
public Animator transition;
public float transitionTime = 1f;
// Method to load the Augmentable scene
public void LoadAugmentable()
{
StartCoroutine(LoadLevel("Augmentable"));
}
// Method to load the MainMenu scene
public void LoadMainMenu()
{
StartCoroutine(LoadLevel("MainMenu"));
}
// Method to load the GroundFloor scene
public void LoadGroundFloor()
{
StartCoroutine(LoadLevel("Ground"));
}
// Method to load the SecondFloor scene
public void LoadSecondFloor()
{
StartCoroutine(LoadLevel("2NDFLOOR"));
}
// Method to load the ThirdFloor scene
public void LoadThirdFloor()
{
StartCoroutine(LoadLevel("3RDFLOOR"));
}
// Method to load the FourthFloor scene
public void LoadFourthFloor()
{
StartCoroutine(LoadLevel("4THFLOOR"));
}
// Method to load the FifthFloor scene
public void LoadFifthFloor()
{
StartCoroutine(LoadLevel("5THFLOOR"));
}
// Method to load the Scanner scene
public void LoadScanner()
{
StartCoroutine(LoadLevel("SampleScene"));
}
public void LoadHistory()
{
StartCoroutine(LoadLevel("History"));
}
public void LoadInstructions()
{
StartCoroutine(LoadLevel("Instructions"));
}
public void LoadLibQR()
{
StartCoroutine(LoadLevel("LibraryQR"));
}
public void LoadDownloadQR()
{
StartCoroutine(LoadLevel("Download"));
}
// Coroutine to handle the transition and loading of scenes
IEnumerator LoadLevel(string sceneName)
{
// Play transition animation
transition.SetTrigger("Start");
// Wait for transition time
yield return new WaitForSeconds(transitionTime);
// Load the scene
SceneManager.LoadScene(sceneName);
}
}