예제 #1
0
        //Append the touch log to the file
        public static void AppendData()
        {
            StreamWriter file;
            string       log = GestureManager.GetLog();

            file = new StreamWriter(Application.persistentDataPath + FILE_NAME, true);
            file.WriteLine(log);
            file.Close();
        }
예제 #2
0
        //Submit the information of the GestureManager to the database
        static public IEnumerator SubmitLog()
        {
            WWWForm form = new WWWForm();

            form.AddField("data", GestureManager.GetLog());

            var link = new WWW(LOG_ADDRESS, form);

            yield return(link);
        }
예제 #3
0
        //Save the log into a file.
        public void SaveFile()
        {
            StreamWriter file;
            string       log = GestureManager.GetLog();

            //If the log is empty skip the serialization
            if (log != "{ \"info\":{} }")
            {
                if (File.Exists(Application.persistentDataPath + FILE_NAME))
                {
                    file = new StreamWriter(Application.persistentDataPath + FILE_NAME, true);
                }
                else
                {
                    file = new StreamWriter(Application.persistentDataPath + FILE_NAME, false);
                }

                file.WriteLine(log);
                file.Close();

                Debug.Log("Log File: " + Application.persistentDataPath + FILE_NAME);
            }
        }