28 lines
840 B
C#
28 lines
840 B
C#
using UnityEngine;
|
|
using UnityEditor;
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
public class Participant
|
|
{
|
|
public string[][] trials;
|
|
public string inputMethod;
|
|
public int participantId;
|
|
|
|
public Participant(string json)
|
|
{
|
|
JObject jObject = JObject.Parse(json);
|
|
JArray jTrials = (JArray)jObject["trials"];
|
|
this.trials = new string[jTrials.Count][];
|
|
for (int i = 0;i<jTrials.Count;i++)
|
|
{
|
|
JArray ja = (JArray)jTrials[i];
|
|
this.trials[i] = new string[ja.Count];
|
|
for(int j = 0; j < ja.Count;j++)
|
|
{
|
|
this.trials[i][j] = ja[j].ToString();
|
|
}
|
|
}
|
|
this.inputMethod = jObject["inputMethod"].ToString();
|
|
this.participantId = int.Parse(jObject["participantId"].ToString());
|
|
}
|
|
} |