public void Update() { if (PlayerScored && BallScored) { _EndScreen.SetActive(true); } }
private void Awake() { if (defaultInstance != null) { throw new Exception("Multiple Manager-Scripts Found!"); } defaultInstance = this; DisableAR(); StartScreen.SetActive(true); EndScreen.SetActive(false); Change(0); StartCoroutine(Late()); SceneUtils.RequestTransition(new Transition(TransitionType.FADE_IN)); }
void Update() { if (Input.GetKeyDown(KeyCode.Escape) && Application.loadedLevelName == "Game") { EndScreen.SetActive(true); } //Show only first digit on Timer Text TimerText.text = "" + CountDownTime.ToString("f0"); //Show EndScreen if time is less or equal to 0 if (CountDownTime <= 0f) { EndScreen.SetActive(true); } //Countdown if (!EndScreen.activeInHierarchy) { CountDownTime -= Time.deltaTime; } //Keep Chars next to the relative question if (AnswerAGO.transform.localPosition == Button1Pos) { CharA.GetComponentInChildren <Text>().text = "A:"; } if (AnswerBGO.transform.localPosition == Button1Pos) { CharB.GetComponentInChildren <Text>().text = "A:"; } if (AnswerCGO.transform.localPosition == Button1Pos) { CharC.GetComponentInChildren <Text>().text = "A:"; } if (AnswerDGO.transform.localPosition == Button1Pos) { CharD.GetComponentInChildren <Text>().text = "A:"; } if (AnswerAGO.transform.localPosition == Button2Pos) { CharA.GetComponentInChildren <Text>().text = "B:"; } if (AnswerBGO.transform.localPosition == Button2Pos) { CharB.GetComponentInChildren <Text>().text = "B:"; } if (AnswerCGO.transform.localPosition == Button2Pos) { CharC.GetComponentInChildren <Text>().text = "B:"; } if (AnswerDGO.transform.localPosition == Button2Pos) { CharD.GetComponentInChildren <Text>().text = "B:"; } if (AnswerAGO.transform.localPosition == Button3Pos) { CharA.GetComponentInChildren <Text>().text = "C:"; } if (AnswerBGO.transform.localPosition == Button3Pos) { CharB.GetComponentInChildren <Text>().text = "C:"; } if (AnswerCGO.transform.localPosition == Button3Pos) { CharC.GetComponentInChildren <Text>().text = "C:"; } if (AnswerDGO.transform.localPosition == Button3Pos) { CharD.GetComponentInChildren <Text>().text = "C:"; } if (AnswerAGO.transform.localPosition == Button4Pos) { CharA.GetComponentInChildren <Text>().text = "D:"; } if (AnswerBGO.transform.localPosition == Button4Pos) { CharB.GetComponentInChildren <Text>().text = "D:"; } if (AnswerCGO.transform.localPosition == Button4Pos) { CharC.GetComponentInChildren <Text>().text = "D:"; } if (AnswerDGO.transform.localPosition == Button4Pos) { CharD.GetComponentInChildren <Text>().text = "D:"; } }
//Checks if the user has pressed the "Home" Button void OnApplicationPause() { EndScreen.SetActive(true); }