fix dot distance
This commit is contained in:
parent
fa8338a904
commit
c101d05ff1
@ -33,9 +33,10 @@ public class ExperimentController : MonoBehaviour {
|
||||
#endif
|
||||
UnityEngine.Debug.Log(platform);
|
||||
string response = "";
|
||||
UnityEngine.Debug.Log(Application.persistentDataPath);
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
string endpoint = "http://do.superpichu.org:5000/" + platform;
|
||||
string endpoint = "http://<URL OF SERVER INSTANCE>" + platform;
|
||||
response = client.DownloadString(endpoint);
|
||||
UnityEngine.Debug.Log("Received Response: " + response);
|
||||
}
|
||||
@ -72,8 +73,8 @@ public class ExperimentController : MonoBehaviour {
|
||||
double time = stopwatch.Elapsed.TotalSeconds;
|
||||
stopwatch.Reset();
|
||||
double angle = Vector3.Angle(nextDot.transform.position, playerCamera.transform.position);
|
||||
double distance = Vector3.Distance(nextDot.transform.position, startDot.transform.position);
|
||||
SaveSample(angle, distance, time, false);
|
||||
//double distance = Vector3.Distance(nextDot.transform.position, startDot.transform.position);
|
||||
SaveSample(angle, time, false);
|
||||
}
|
||||
if (trialDotIndex < participant.trials[trialIndex].Length)
|
||||
{
|
||||
@ -116,8 +117,8 @@ public class ExperimentController : MonoBehaviour {
|
||||
double time = stopwatch.Elapsed.TotalSeconds;
|
||||
stopwatch.Reset();
|
||||
double angle = Vector3.Angle(nextDot.transform.position, playerCamera.transform.position);
|
||||
double distance = Vector3.Distance(nextDot.transform.position, startDot.transform.position);
|
||||
SaveSample(angle, distance, time, true);
|
||||
//double distance = Vector3.Distance(nextDot.transform.position, startDot.transform.position);
|
||||
SaveSample(angle, time, true);
|
||||
Hide(nextDot);
|
||||
Show(startDot);
|
||||
stopwatch.Start();
|
||||
@ -146,11 +147,20 @@ public class ExperimentController : MonoBehaviour {
|
||||
}
|
||||
}
|
||||
|
||||
void SaveSample(double angle, double distance, double time, bool direction)
|
||||
void SaveSample(double angle, double time, bool direction)
|
||||
{
|
||||
Sample sample = new Sample();
|
||||
sample.Angle = angle;
|
||||
sample.Distance = distance;
|
||||
if(nextDot.name.Contains("Short")){
|
||||
sample.Distance = 500;
|
||||
}
|
||||
else if(nextDot.name.Contains("Medium")){
|
||||
sample.Distance = 1000;
|
||||
}
|
||||
else if(nextDot.name.Contains("Long")){
|
||||
sample.Distance = 1500;
|
||||
}
|
||||
else
|
||||
sample.Time = time;
|
||||
sample.Direction = direction;
|
||||
sample.DotName = nextDot.name;
|
||||
|
Loading…
Reference in New Issue
Block a user