Example #1
0
 public void ForceStopTest()
 {
     STKEventReceiver.SendEvents();
     STKEventReceiver.ClearEvents();
     STKJsonParser.TestEnd();
     STKJsonParser.CreateFile();
     SceneManager.LoadScene(SceneManager.GetActiveScene().name);
 }
        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();
            }
        }