示例#1
0
 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");
     }
 }
示例#2
0
    /// <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]);
        }
    }
示例#3
0
 private void Start()
 {
     CalibrationUI.UpdateMessage(messages[this.curStage]);
 }
示例#4
0
 protected override void Awake()
 {
     base.Awake();
     this.defaultActive = true;
     instance           = GameObject.FindGameObjectsWithTag("HUD")[0].GetComponent <CalibrationUI>();
 }