Exemple #1
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;
    }
Exemple #2
0
    public void GenerateVisualization()
    {
        // RESET existing vis?
        GuestEntryData guestData;        // = new GuestEntryData();

        //guestData.init ();
        //dataManager.SaveData (guestData);
        dataManager.LoadData();
        guestData = dataManager.LocalCopyOfData;
        for (int i = 0; i < guestData.time.Count; i++)
        {
            Texture2D snap = null;
            if (guestData.guestAvatar[i] != null && guestData.guestAvatar[i].Length > 0)
            {
                snap = new Texture2D(camControl.frontCam.width, camControl.frontCam.height);
                snap.LoadImage(guestData.guestAvatar [i]);
            }

            AddEntry(snap, guestData.text[i], guestData.date[i], guestData.time[i], guestData.count[i]);
        }
    }