Tanoda
VRPopupManager.cs
Go to the documentation of this file.
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using GILES;
5using UnityEngine;
6using UnityEngine.UI;
7
8public class VRPopupManager : pb_MonoBehaviourSingleton<VRPopupManager>
9{
10 [SerializeField]private GameObject popupWindow;
11 [SerializeField]private GameObject popupWindow2;
12 [SerializeField]private Text popupText;
13 [SerializeField]private Text popUpTitle;
14 [SerializeField]private Text popupTextCurrent;
15 [SerializeField]private Text popupTextPBest;
16 [SerializeField]private Text popupTextBest;
17 [SerializeField]private Text popupTextAvg;
18 [SerializeField]private Text popupTextAcc;
19 [SerializeField]private Text popupTextFoc;
20 [SerializeField]private Text popupTextOVT;
21 [SerializeField]private Text popupUser;
22
23 public void ShowPopup()
24 {
25 popupWindow.SetActive(true);
26 popupWindow2.SetActive(true);
27 }
28
29 public void HideAfter(float seconds)
30 {
31 StartCoroutine(DelayAction(HidePopup, seconds));
32 }
33
34 public void HidePopup()
35 {
36 popupWindow.SetActive(false);
37 popupWindow2.SetActive(false);
38 }
39#if DANA
40 public void SetText(string title, string current, string acc, string foc , string ovt)
41 {
42 popUpTitle.text = title;
43 popupTextCurrent.text = current;
44 popupTextAcc.text = acc;
45 popupTextFoc.text = foc;
46 popupTextOVT.text = ovt;
47 popupUser.text = SavedUser.instance.currentUser.Value.Username.ToUpper() + "!";
48 }
49#else
50 public void SetText(string value)
51 {
52 popupText.text = value;
53 }
54#endif
55
56 private IEnumerator DelayAction(Action a, float t)
57 {
58 yield return new WaitForSeconds(t);
59 a();
60 }
61
62}
void SetText(string value)
void HideAfter(float seconds)