-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecordUI.cs
112 lines (72 loc) · 2.02 KB
/
RecordUI.cs
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using MaterialUI;
public class RecordUI : MonoBehaviour {
[SerializeField]
private GameObject recordButton;
[SerializeField]
private GameObject fileOpenButton;
[SerializeField]
private GameObject controlsPanel;
[SerializeField]
private GameObject diagnosticsPanel;
[SerializeField]
private Text recordButtonText;
[SerializeField]
private Text openFileButtonText;
[SerializeField]
private MaterialSlider seekBarSlider;
[SerializeField]
private GameObject SuccessPopup;
[SerializeField]
private Image seekBarBlockFocus;
private Color seekBarColor;
private bool bRecord = false;
// Use this for initialization
void Start () {
resetRecordUI ();
}
public void resetRecordUI(){
seekBarBlockFocus.enabled = false;
controlsPanel.SetActive (true);
diagnosticsPanel.SetActive (true);
seekBarColor = seekBarSlider.enabledColor;
recordButtonText.text = "Record";
SuccessPopup.SetActive (false);
}
public void recordingRecordUI(){
bRecord = !bRecord;
//start recording
if (bRecord) {
seekBarBlockFocus.enabled = true;
controlsPanel.SetActive (false);
diagnosticsPanel.SetActive (false);
seekBarSlider.enabledColor = Color.red;
recordButtonText.text = "Cancel";
SuccessPopup.SetActive (false);
} else {
seekBarBlockFocus.enabled = false;
diagnosticsPanel.SetActive (true);
controlsPanel.SetActive (true);
seekBarSlider.enabledColor = seekBarColor;
recordButtonText.text = "Record";
SuccessPopup.SetActive (false);
}
}
public void successRecordUI(){
bRecord = !bRecord;
seekBarBlockFocus.enabled = false;
controlsPanel.SetActive (true);
diagnosticsPanel.SetActive (true);
seekBarSlider.enabledColor = seekBarColor;
recordButtonText.text = "Record";
SuccessPopup.SetActive (true);
StartCoroutine (HidePopUp());
}
IEnumerator HidePopUp(){
yield return new WaitForSeconds (5);
SuccessPopup.SetActive (false);
}
}