Ejemplo n.º 1
0
 public void ForceStopTest()
 {
     STKEventReceiver.SendEvents();
     STKEventReceiver.ClearEvents();
     STKJsonParser.TestEnd();
     STKJsonParser.CreateFile();
     SceneManager.LoadScene(SceneManager.GetActiveScene().name);
 }
Ejemplo n.º 2
0
 public static void SaveRunning() //Saves an unfinished Experiment/Stage
 {
     ReceiveEvents(STKEventReceiver.GetEvents());
     STKEventReceiver.ClearEvents();
     endString = "}\n";
     stageString[currentStage] = "\"Stage" + currentStage.ToString() + "\":" + startString + eventString + endString;
     CreateFile();
     startString = null;
     stageString = null;
     eventString = null;
     endString   = null;
     TestStart(latestStage);
 }
Ejemplo n.º 3
0
        public void ToggleTest(GameObject button)
        {
            if (!started)
            {
                STKEventReceiver.ClearEvents();
                values = new Hashtable();
                foreach (STKTestControllerProperty p in startProperties)
                {
                    values.Add(p.text.text, p.GetValue());
                    p.gameObject.SetActive(false);
                }
                foreach (STKTestControllerProperty p in runningProperties)
                {
                    p.gameObject.SetActive(true);
                }
                if (hasTimeLimit)
                {
                    timeText.transform.parent.gameObject.SetActive(true);
                }
                button.GetComponent <Button>().GetComponentInChildren <Text>().text = "Stop Stage";
                foreach (GameObject g in GameobjectsToActivate)
                {
                    g.SetActive(true);
                }
                for (int i = 0; i < GameobjectsToSendMessageTo.Count; i++)
                {
                    GameobjectsToSendMessageTo[i].SendMessage(messagesToSend[i]);
                }
                foreach (GameObject g in GameobjectsToDeActivate)
                {
                    g.SetActive(false);
                }

                STKJsonParser.TestStart(values);
                started = true;
            }
            else
            {
                foreach (STKTestControllerProperty p in startProperties)
                {
                    p.gameObject.SetActive(true);
                    p.Clear();
                }
                foreach (STKTestControllerProperty p in runningProperties)
                {
                    values.Add(p.text.text, p.GetValue());
                    p.gameObject.SetActive(false);
                }
                foreach (GameObject g in GameobjectsToActivate)
                {
                    g.SetActive(false);
                }
                time = 0;
                timeText.transform.parent.gameObject.SetActive(false);
                STKEventReceiver.SendEvents();
                STKEventReceiver.ClearEvents();
                STKJsonParser.TestEnd();
                started = false;
                myController.StageEnded();
            }
        }