Tanoda
QRDecodeTest.cs
Go to the documentation of this file.
1
using
System.Collections;
2
using
NaughtyAttributes;
3
using
UnityEngine
;
4
using
UnityEngine
.
Events
;
5
using
UnityEngine
.
UI
;
6
7
public
class
QRDecodeTest
: MonoBehaviour
8
{
9
public
QRCodeDecodeController
e_qrController
;
10
11
public
InputField
UiText
;
12
13
public
UnityEvent
OnRecognition
;
14
15
IEnumerator Start()
16
{
17
if
(
e_qrController
!=
null
)
e_qrController
.
onQRScanFinished
+= qrScanFinished;
18
yield
return
new
WaitForSeconds(1);
19
//Play();
20
}
21
22
private
void
qrScanFinished(
string
dataText)
23
{
24
UiText
.text = dataText;
25
OnRecognition
?.Invoke();
26
//Play();
27
Stop
();
28
}
29
30
public
void
Reset
()
31
{
32
if
(
e_qrController
!=
null
)
e_qrController
.
Reset
();
33
}
34
35
[
Button
]
36
public
void
Play
()
37
{
38
Reset
();
39
if
(
e_qrController
!=
null
)
e_qrController
.
StartWork
();
40
}
41
42
[
Button
]
43
public
void
Stop
()
44
{
45
if
(
e_qrController
!=
null
)
e_qrController
.
StopWork
();
46
}
47
48
private
void
OnDestroy()
49
{
50
e_qrController
.
StopWork
();
51
}
52
53
private
void
OnDisable()
54
{
55
if
(
e_qrController
!=
null
)
e_qrController
.
StopWork
();
56
}
57
58
//private void OnEnable()
59
//{
60
// Play();
61
//}
62
}
Button
UnityEngine.UI.Button Button
Definition:
Pointer.cs:7
QRCodeDecodeController
Definition:
QRCodeDecodeController.cs:10
QRCodeDecodeController.Reset
void Reset()
Reset this scan param
Definition:
QRCodeDecodeController.cs:132
QRCodeDecodeController.StopWork
void StopWork()
Stops the work.
Definition:
QRCodeDecodeController.cs:151
QRCodeDecodeController.StartWork
void StartWork()
Stops the work.
Definition:
QRCodeDecodeController.cs:141
QRCodeDecodeController.onQRScanFinished
QRScanFinished onQRScanFinished
Definition:
QRCodeDecodeController.cs:13
QRDecodeTest
Definition:
QRDecodeTest.cs:8
QRDecodeTest.OnRecognition
UnityEvent OnRecognition
Definition:
QRDecodeTest.cs:13
QRDecodeTest.UiText
InputField UiText
Definition:
QRDecodeTest.cs:11
QRDecodeTest.Stop
void Stop()
Definition:
QRDecodeTest.cs:43
QRDecodeTest.Play
void Play()
Definition:
QRDecodeTest.cs:36
QRDecodeTest.e_qrController
QRCodeDecodeController e_qrController
Definition:
QRDecodeTest.cs:9
QRDecodeTest.Reset
void Reset()
Definition:
QRDecodeTest.cs:30
UnityEngine.Events
UnityEngine.UI
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
QRcode
Scripts
QRDecodeTest.cs
Generated by
1.9.3