Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     // if its time to fetch info
     // FetchInfo();
     currentTimeLeft    -= Time.deltaTime;
     currentVisTimeLeft -= Time.deltaTime;
     if (currentTimeLeft < 0)
     {
         //Debug.Log ("checking text");
         StartCoroutine(FetchInfo());
         currentTimeLeft = timeLeft;
     }
     if (currentVisTimeLeft < 0 && lastVisitorCount > 0)
     {
         //Debug.Log ("Vistime rand out:" + currentVisTimeLeft);
         Texture2D snap = null;
         visGen.AddEntry(snap, "", currentDate, currentTime, lastVisitorCount);
         currentVisTimeLeft = visTime;
         //Debug.Log ("Setting  currentVisTimeLeft to: " + currentVisTimeLeft);
         GuestEntryData guestData = dataManager.LocalCopyOfData;
         guestData.guestAvatar.Add(new byte[] {  });                   // 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20
         guestData.time.Add(currentTime);
         guestData.date.Add(currentDate);
         guestData.count.Add(lastVisitorCount);
         //Debug.Log ("lastVisitorCount: " + lastVisitorCount.ToString());
         guestData.text.Add("");
         lastVisitorCount = 0;
         dataManager.SaveData(guestData);
     }
 }
 public bool createUser(string Email)
 {
     if (!lsd.login.ContainsKey(Email))
     {
         string Password = Email;
         lsd.login.Add(Email, Password);
         lsd.SaveData();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #3
0
    public void sendData()
    {
        if (inputField.text == "" && camControl.snapshot == null)
        {
            return;
        }

        if (dataManager.LocalCopyOfData == null)
        {
            dataManager.LoadData();
        }

        guestData = dataManager.LocalCopyOfData;

        System.DateTime.Now.ToString("MMMM");
        string currentDate = System.DateTime.Now.ToString("dd");

        currentDate += GetDaySuffix(System.DateTime.Now.Day);
        currentDate += " " + System.DateTime.Now.ToString("MMMM");
        string currentTime = System.DateTime.Now.ToString("hh:mm tt");

        guestData.time.Add(currentTime);
        guestData.date.Add(currentDate);
        guestData.text.Add(inputField.text);
        guestData.count.Add(0);

        if (camControl.snapshot != null)
        {
            guestData.guestAvatar.Add(camControl.snapshot.EncodeToPNG());
        }
        else
        {
            guestData.guestAvatar.Add(new byte[] {  });
        }

        visGen.AddEntry(camControl.snapshot, inputField.text, currentDate, currentTime, 0);
        // call SaveData
        dataManager.SaveData(guestData);

        // reset guestbook
        inputField.text         = "";
        pictureAvatar.texture   = null;
        camControl.snapshot     = null;
        camControl.pictureTaken = false;
    }