65 lines
2.6 KiB
C#
65 lines
2.6 KiB
C#
|
using System;
|
|||
|
using System.Text;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class ExperimentController : MonoBehaviour {
|
|||
|
|
|||
|
GameObject startDot;
|
|||
|
GameObject nextDot;
|
|||
|
int trialIndex;
|
|||
|
int trialDotIndex;
|
|||
|
Participant participant;
|
|||
|
// Use this for initialization
|
|||
|
void Start () {
|
|||
|
//FOR THE LOVE OF GOD FUCKING DELETE THIS, SERIOUSLY CHRIS DON'T YOU DARE FORGET
|
|||
|
string fuck = "ewoidHJpYWxzIiA6IFsKICBbIkxlZnRMb25nIiwiUmlnaHRNZWRpdW0iLCJMZWZ0U2hvcnQiLCJVcE1lZGl1bSIsIlVwTG9uZyIsIlJpZ2h0U2hvcnQiXSwKICBbIlVwU2hvcnQiLCJSaWdodExvbmciLCJMZWZ0TWVkaXVtIiwiUmlnaHRNZWRpdW0iLCJMZWZ0TG9uZyIsIlVwTG9uZyJdLAogIFsiUmlnaHRTaG9ydCIsIlVwTWVkaXVtIiwiTGVmdE1lZGl1bSIsIkxlZnRTaG9ydCIsIlJpZ2h0TG9uZyIsIlVwU2hvcnQiXSwKICBbIkxlZnRMb25nIiwiUmlnaHRNZWRpdW0iLCJMZWZ0U2hvcnQiLCJVcE1lZGl1bSIsIlVwTG9uZyIsIlJpZ2h0U2hvcnQiXSwKICBbIlVwU2hvcnQiLCJSaWdodExvbmciLCJMZWZ0TWVkaXVtIiwiUmlnaHRNZWRpdW0iLCJMZWZ0TG9uZyIsIlVwTG9uZyJdLAogIFsiUmlnaHRTaG9ydCIsIlVwTWVkaXVtIiwiTGVmdE1lZGl1bSIsIkxlZnRTaG9ydCIsIlJpZ2h0TG9uZyIsIlVwU2hvcnQiXSwKICBbIkxlZnRMb25nIiwiUmlnaHRNZWRpdW0iLCJMZWZ0U2hvcnQiLCJVcE1lZGl1bSIsIlVwTG9uZyIsIlJpZ2h0U2hvcnQiXSwKICBbIlVwU2hvcnQiLCJSaWdodExvbmciLCJMZWZ0TWVkaXVtIiwiUmlnaHRNZWRpdW0iLCJMZWZ0TG9uZyIsIlVwTG9uZyJdLAogIFsiUmlnaHRTaG9ydCIsIlVwTWVkaXVtIiwiTGVmdE1lZGl1bSIsIkxlZnRTaG9ydCIsIlJpZ2h0TG9uZyIsIlVwU2hvcnQiXQpdLAoicGFydGljaXBhbnRJZCIgOiAxLAoiaW5wdXRNZXRob2QiIDogImNhcmRib2FyZCIKfQo=";
|
|||
|
byte[] decodedBytes = Convert.FromBase64String(fuck);
|
|||
|
string decodedText = Encoding.UTF8.GetString(decodedBytes);
|
|||
|
UnityEngine.Debug.Log(decodedText);
|
|||
|
participant = new Participant(decodedText);
|
|||
|
startDot = GameObject.Find("StartButton");
|
|||
|
trialIndex = 0;
|
|||
|
trialDotIndex = 0;
|
|||
|
foreach (GameObject go in GameObject.FindGameObjectsWithTag("Dot"))
|
|||
|
{
|
|||
|
Hide(go);
|
|||
|
};
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
void Hide(GameObject dot)
|
|||
|
{
|
|||
|
dot.GetComponent<SpriteRenderer>().enabled = false;
|
|||
|
//dot.GetComponent<CircleCollider2D>().enabled = false;
|
|||
|
}
|
|||
|
|
|||
|
void Show(GameObject dot)
|
|||
|
{
|
|||
|
dot.GetComponent<SpriteRenderer>().enabled = true;
|
|||
|
//dot.GetComponent<CircleCollider2D>(). = true;
|
|||
|
}
|
|||
|
|
|||
|
public void NextDot()
|
|||
|
{
|
|||
|
nextDot = GameObject.Find(participant.trials[trialIndex][trialDotIndex]);
|
|||
|
trialDotIndex++;
|
|||
|
Show(nextDot);
|
|||
|
Hide(startDot);
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public void BackToStart()
|
|||
|
{
|
|||
|
Hide(nextDot);
|
|||
|
//nextDot = GameObject.Find(participant.trials[trialIndex][trialDotIndex]);
|
|||
|
Show(startDot);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
// Update is called once per frame
|
|||
|
void Update () {
|
|||
|
|
|||
|
}
|
|||
|
}
|