public void Init() { try { ui = GameObject.Find("CalibrationUI").GetComponent <CalibrationUI>(); compassEnabled = EnableCompass(); cam = GameObject.FindWithTag("MainCamera").GetComponent <Camera>(); } catch (NullReferenceException e) { Debug.Log(e); Debug.Log("Init failed, will have to be init again, when used"); } }
/// <summary> /// Progresses to the next stage of calibration /// </summary> private void ProgressCalibration() { if (this.curStage >= firstCalibrationStage) { this.maxDyTotal += this.maxDy; this.maxDy = 0; } this.curStage++; if (this.curStage >= messages.Length) { // Update the Sensitivity with the average of the three calibration trials (scaled by calibrationFactor) Settings.Sensitivity = (this.maxDyTotal / 3) * calibrationFactor; SceneManager.LoadScene("MainMenu"); } else { CalibrationUI.UpdateMessage(messages[this.curStage]); } }
private void Start() { CalibrationUI.UpdateMessage(messages[this.curStage]); }
protected override void Awake() { base.Awake(); this.defaultActive = true; instance = GameObject.FindGameObjectsWithTag("HUD")[0].GetComponent <CalibrationUI>(); }