Esempio n. 1
0
 public void DisableBackgroundScan()
 {
     debugOutput.text += "\nDisableBackgroundScan";
     AndroidNFCReader.disableBackgroundScan();
     background = false;
     scanNFCButton.interactable = !background;
 }
Esempio n. 2
0
 void OnGUI()
 {
     if (!background)
     {
         // Scan NFC button
         if (GUI.Button(new Rect(0, Screen.height - 50, Screen.width, 50), "Scan NFC"))
         {
             AndroidNFCReader.ScanNFC(gameObject.name, "OnFinishScan");
         }
         if (GUI.Button(new Rect(0, Screen.height - 100, Screen.width, 50), "Enable Backgraound Mode"))
         {
             AndroidNFCReader.enableBackgroundScan();
             background = true;
         }
     }
     else
     {
         if (GUI.Button(new Rect(0, Screen.height - 50, Screen.width, 50), "Disable Backgraound Mode"))
         {
             AndroidNFCReader.disableBackgroundScan();
             background = false;
         }
     }
     GUI.Label(new Rect(0, 0, Screen.width, 50), "Result: " + qrString);
 }
Esempio n. 3
0
    void OnGUI()
    {
        if (!background)
        {
            // Scan NFC button
            if (GUI.Button(new Rect(0, Screen.height - 50, Screen.width, 50), "Scan NFC"))
            {
                AndroidNFCReader.ScanNFC(gameObject.name, "OnFinishScan");
            }
            if (GUI.Button(new Rect(0, Screen.height - 100, Screen.width, 50), "Enable Backgraound Mode"))
            {
                AndroidNFCReader.enableBackgroundScan();
                background = true;
            }
        }
        else
        {
            if (GUI.Button(new Rect(0, Screen.height - 50, Screen.width, 50), "Disable Backgraound Mode"))
            {
                AndroidNFCReader.disableBackgroundScan();
                background = false;
            }
        }
        if (qrString != "NO_ALLOWED_OS")
        {
            Debug.Log(qrString);
            GUI.Label(new Rect(0, 0, Screen.width, 50), "Result: " + qrString + "new Version");
            if (qrString.Length < 3)
            {
                string url = "http://192.168.0.151:8000/";
                t.RoomNumber = Int32.Parse(qrString);
                WWWForm form = new WWWForm();
                form.AddField("", t.RoomNumber);
                form.AddField("", t.TeamId);
                byte[] rawData = form.data;
                var    headers = new Dictionary <string, string>();
                headers.Add("Stage", "RoomEntery");

                WWW www = new WWW(url, rawData, headers);

                StartCoroutine(WaitForRequest(www));
            }
        }
    }