Esempio n. 1
0
    void qrScanFinished(string dataText)
    {
        print(dataText);
//        Game.Get().CurrentCanvas.SetActive(true);
        if (Game.Get().CurrentCanvas.name == "StartCanvas")
        {
//	        UiText.text = dataText;
            DatabaseManager.Get().retrieveByEmail(dataText, data =>
            {
                if (data != null)
                {
                    RetryQRButton.SetActive(false);
                    e_qrController.StopCamera();
                    NextButtonLogin.SetActive(true);
                    Game.Get().User = data;
                    UiText.text     = "U bent ingelogd als " + data.FirstName + " " + data.LastName + " op het email " +
                                      data.Email;
                    print("U bent ingelogd als " + data.FirstName + " " + data.LastName + " op het email " +
                          data.Email);
                }
                else
                {
                    print("bla123");
                    UiText.text = "QR code incorrect.";
                    RetryQRButton.SetActive(true);
                    e_qrController.StopCamera();

//                    e_qrController.StartCamera();
                }
                //	        Panel1.transform.Find("Name").GetComponent<Text>().text = data[0].FirstName;
            });
        }
        else
        {
            DatabaseManager.Get().retrieveByEmail(dataText, data =>
            {
                if (data != null)
                {
                    if (Game.Get().User.Email != data.Email)
                    {
                        Game.Get().TriggerScanned(data);
                    }
                    e_qrController.StopCamera();
                }
                else
                {
                    e_qrController.StopCamera();
                }
            });
        }
    }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         ExitPanel.transform.SetParent(CurrentCanvas.transform);
         if (ExitPanel == null)
         {
             ExitPanel = Instantiate(Resources.Load <GameObject>("Prefabs/Exit Panel"));
             ExitPanel.transform.SetParent(gameObject.transform);
             ExitPanel.transform.position = new Vector3(0, 0, 0);
             ExitPanel.SetActive(true);
             ExitPanel.transform.Find("Exit").Find("Button Layer").GetComponent <Button>().onClick.AddListener(ExitClick);
             ExitPanel.transform.Find("Close").Find("Button Layer").GetComponent <Button>().onClick.AddListener(CloseClick);
         }
         ExitPanel.transform.Find("Exit").Find("Button Layer").GetComponent <Button>().onClick.AddListener(ExitClick);
         ExitPanel.transform.Find("Close").Find("Button Layer").GetComponent <Button>().onClick.AddListener(CloseClick);
         ExitPanel.SetActive(!ExitPanel.activeSelf);
         if (qrController.e_DeviceController.cameraTexture.isPlaying)
         {
             qrController.StopCamera();
             CameraShown = true;
         }
     }
 }