public void CreateTest(VWMTestItem t) { float fullScreenHeight = Camera.main.orthographicSize * 2; float fullScreenWidth = fullScreenHeight * 16 / 9; // basically height * screen aspect ratio //this will give us the world unit width of the screen (doubled it to account for the negative side) //divide the screen width by the amount of objects in the array to get offset from left side //changed this to fix something, make sure it didn't break everything else //float offsetX = fullScreenWidth / (t.LetterButtons.Length + 2); float offsetY = fullScreenHeight / 2; //float leftScreenPos = -fullScreenWidth / 2 + offsetX / 2; float topScreenPos = fullScreenHeight / 2 - offsetY / 2; GameObject o; if (!GameObject.Find("origin")) { o = new GameObject("origin"); o.transform.position = new Vector3(0, -offsetY / 2, 0); TextMesh tm = o.AddComponent <TextMesh>(); tm.alignment = TextAlignment.Center; tm.anchor = TextAnchor.MiddleCenter; tm.fontSize = 100; tm.color = Color.black; o.transform.localScale = Vector3.one * fullScreenHeight / 6f; o = new GameObject("topOrigin"); o.transform.position = new Vector3(0, offsetY / 2, 0); tm = o.AddComponent <TextMesh>(); tm.alignment = TextAlignment.Center; tm.anchor = TextAnchor.MiddleCenter; tm.fontSize = 100; tm.color = Color.black; o.transform.localScale = Vector3.one * fullScreenHeight / 6f; //o.layer = LayerMask.NameToLayer("fade"); o = new GameObject("midOrigin"); o.transform.position = new Vector3(0, 0, 0); tm = o.AddComponent <TextMesh>(); tm.alignment = TextAlignment.Center; tm.anchor = TextAnchor.MiddleCenter; tm.fontSize = 100; tm.color = Color.black; o.transform.localScale = Vector3.one * fullScreenHeight / 6f; //o.layer = LayerMask.NameToLayer("fade"); o = new GameObject("audio"); o.transform.position = new Vector3((-fullScreenWidth / 16) * 5, -offsetY / 2, 0); o = new GameObject("arrow"); o.transform.position = new Vector3((fullScreenWidth / 16) * 5, -offsetY / 2, 0); } //if (!t.skipPrint) // VWMOutputHandler.StartTimer(0); }
void setNextTestItem() { base.backEndItem = base.testItemBackEnd[base.currentTestNumber]; frontEndItem = testItemFrontEnd[base.currentTestNumber]; base.nextTest = false; }