From 5c9a0f81379c58a3d34486a5e9a46240f4089226 Mon Sep 17 00:00:00 2001 From: Chris Midkiff Date: Mon, 22 Jun 2020 13:30:08 -0400 Subject: [PATCH] updated code --- Assets/Scripts/DataSet.cs | 3 ++- Assets/Scripts/ExperimentController.cs | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) mode change 100644 => 100755 Assets/Scripts/ExperimentController.cs diff --git a/Assets/Scripts/DataSet.cs b/Assets/Scripts/DataSet.cs index 4d29dd0..639dabf 100755 --- a/Assets/Scripts/DataSet.cs +++ b/Assets/Scripts/DataSet.cs @@ -42,7 +42,8 @@ namespace Assets.Scripts client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; string ud = "userStudyId=" + name + "&userStudyData=" + data; - client.UploadStringAsync(new Uri(endpoint), ud); + string r = client.UploadString(new Uri(endpoint),"POST", ud); + UnityEngine.Debug.Log(r); } } diff --git a/Assets/Scripts/ExperimentController.cs b/Assets/Scripts/ExperimentController.cs old mode 100644 new mode 100755 index 50a595b..b91cb25 --- a/Assets/Scripts/ExperimentController.cs +++ b/Assets/Scripts/ExperimentController.cs @@ -31,13 +31,14 @@ public class ExperimentController : MonoBehaviour { #if UNITY_STANDALONE_WIN platform = "oculus"; #endif + platform = "mouse"; UnityEngine.Debug.Log(platform); string response = ""; UnityEngine.Debug.Log(Application.persistentDataPath); //Load Trial data from server using (WebClient client = new WebClient()) { - string endpoint = "http://" + platform; + string endpoint = "http:///" + platform; response = client.DownloadString(endpoint); UnityEngine.Debug.Log("Received Response: " + response); } @@ -172,7 +173,16 @@ public class ExperimentController : MonoBehaviour { else if(nextDot.name.Contains("Long")){ sample.Distance = 1500; } - else + if (nextDot.name.Contains("Up")){ + sample.Angle = 90; + } + else if (nextDot.name.Contains("Right")) + { + sample.Angle = 0; + }else if (nextDot.name.Contains("Left")) + { + sample.Angle = 180; + } sample.Time = time; sample.Direction = direction; sample.DotName = nextDot.name;