Tanoda
QRDecodeTest.cs
Go to the documentation of this file.
1using System.Collections;
2using NaughtyAttributes;
3using UnityEngine;
5using UnityEngine.UI;
6
7public class QRDecodeTest : MonoBehaviour
8{
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();
40 }
41
42 [Button]
43 public void Stop()
44 {
46 }
47
48 private void OnDestroy()
49 {
51 }
52
53 private void OnDisable()
54 {
56 }
57
58 //private void OnEnable()
59 //{
60 // Play();
61 //}
62}
UnityEngine.UI.Button Button
Definition: Pointer.cs:7
void Reset()
Reset this scan param
void StopWork()
Stops the work.
void StartWork()
Stops the work.
UnityEvent OnRecognition
Definition: QRDecodeTest.cs:13
InputField UiText
Definition: QRDecodeTest.cs:11
QRCodeDecodeController e_qrController
Definition: QRDecodeTest.cs:9
void Reset()
Definition: QRDecodeTest.cs:30