void Update() { if (fader == null) { fader = GameObject.FindGameObjectWithTag("Player").GetComponent <FadeOutScene>(); } if (background) { background = popUpText.transform.parent.GetChild(0).gameObject; } if (changing) { if (!(DateTime.Now.Subtract(start).TotalSeconds > infoDelay)) { return; } currentDestination = DestinationParent.transform.GetChild(destIndex); popUpText.text = "Find the " + currentDestination.name; gameObject.GetComponent <Text>().text = "Find the " + currentDestination.name; currentDestination.transform.Find("Cylinder").gameObject.SetActive(true); changing = false; background.SetActive(true); } else { if (fader.isFadedOut()) { SceneManager.LoadScene("Launcher"); } if (currentDestination.transform.Find("Cylinder").gameObject.activeSelf) { return; } destIndex++; if (destIndex < DestinationParent.transform.childCount) { changing = true; start = DateTime.Now; } else { fadingOut = true; } } }
void OnGUI() { if (_nReached == _strokes.Length | (DateTime.Now.Subtract(_start).TotalSeconds > _maxSecs)) { _fader.startFadeOut(); } if (!_fader.isFadedOut()) { return; } if (_once) { return; } _once = true; SceneManager.LoadScene("Launcher"); }
// Update is called once per frame void Update() { if (!_fadeOut) { var locations = ""; locations = Order[_usedOrder[_counter]]; _goalText = Names[int.Parse(locations.Substring(2, 1))]; _posText = Names[int.Parse(locations.Substring(0, 1))]; _lookText = Names[int.Parse(locations.Substring(1, 1))]; FrontText.text = _lookText; InstructionTextLabel.text = "Imagine you are standing at the " + _posText + ", facing the " + _lookText + ". Point to the " + _goalText + "."; if (!_first) { InstructionTextLabel.text += "\n\nUse the \"Enter\" key to confirm or the \"Escape\" key to change"; } if (Input.GetButtonDown("Back")) { if (_first) { _fpc.enabled = false; _first = false; } else { if (_log != null) { var timestamp = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff", System.Globalization.CultureInfo.InvariantCulture); _log.InsertMeasurement("JRD_3D", locations, "Degree", (Target.eulerAngles.y).ToString(), timestamp); } Target.eulerAngles.Set(0, 0, 0); _fpc.transform.rotation = Quaternion.Euler(0, 0, 0); _fpc.ResetRotation(); _counter++; if (_counter < MaxRepetitions) { _first = true; _fpc.enabled = true; } else { _fadeOut = true; } } } if (Input.GetButtonDown("Cancel") && !_first) { _first = true; _fpc.enabled = true; } } if (Fader.isFadedOut()) { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; SceneManager.LoadScene("Launcher"); } }