Tanoda
CurseLoadManager.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
6public class CurseLoadManager : MonoBehaviour
7{
8 // Start is called before the first frame update
10 public bool isTraining, isExam;
11 void Start()
12 {
13 Button button = GetComponent<Button>();
14 button.onClick.AddListener(delegate () { OpenLoadingWindow(); });
15 }
16 public void OpenLoadingWindow()
17 {
18 var currentUser = SavedUser.instance.currentUser.Value;
19 userManager.GetComponent<UserManager>().SetEditor(false);
20 userManager.GetComponent<UserManager>().SetTutorial(false);
21 if (isTraining) userManager.GetComponent<UserManager>().SetMode(0);
22 else if (isExam) userManager.GetComponent<UserManager>().SetMode(1);
23 else userManager.GetComponent<UserManager>().SetMode(2);
24 ModeSelect.SetActive(false);
25 MenuWindow.SetActive(true);
26#if DANA
27 if (Preloader) Preloader.GetComponent<Preloader>().StopLoading();
28#endif
29 if (currentUser.Access == UserManager.UserType.User)
30 {
31 ManageCurse.SetActive(true);
32 userManager.GetComponent<UserManager>().PopulateCurseList(currentUser);
33
34
35 }
36 else GetComponent<MenuLoadScene>().OpenLoadPanel();
37
38 }
39 // Update is called once per frame
40 void Update()
41 {
42
43 }
44}
UnityEngine.UI.Button Button
Definition: Pointer.cs:7
GameObject ManageCurse
GameObject userManager
GameObject MenuWindow
GameObject Preloader
GameObject ModeSelect