Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Test : MonoBehaviour
  6. {
  7. public QRCodeDecodeController e_qrcontroller;
  8. string dataText = "";
  9.  
  10. // Start is called before the first frame update
  11. void Start()
  12. {
  13. e_qrcontroller.onQRScanFinished += assignQRMessage;
  14. }
  15.  
  16. void assignQRMessage(string str)
  17. {
  18. dataText = str;
  19. }
  20.  
  21. private void OnGUI()
  22. {
  23. if (GUI.Button (new Rect (0, 0 , Screen.width, Screen.height / 10), "Reset"))
  24. {
  25. Reset();
  26. }
  27. GUI.Box(new Rect(0, Screen.height / 10, Screen.width, Screen.height / 10), "");
  28. GUI.Label(new Rect(0, Screen.height / 10, Screen.width, Screen.height / 10), dataText);
  29. }
  30.  
  31. void Reset()
  32. {
  33. e_qrcontroller.Reset();
  34. }
  35.  
  36. // Update is called once per frame
  37. void Update()
  38. {
  39.  
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement