Esempio n. 1
0
 private void Update()
 {
     if (!Scene.Cams.DeadCam.activeSelf)
     {
         if (!Scene.HudGui.MpRespawnLabel.gameObject.activeSelf && !this._vrRespawnActive && this._deathTime + this._minDownDuration < Time.time)
         {
             if (ForestVR.Enabled)
             {
                 LocalPlayer.vrPlayerControl.ShowRespawnPrompt(true);
                 this._vrRespawnActive = true;
             }
             else
             {
                 Scene.HudGui.MpRespawnLabel.gameObject.SetActive(true);
             }
         }
         else if ((TheForest.Utils.Input.GetButtonDown("Take") && Scene.HudGui.MpRespawnMaxTimer.gameObject.activeSelf) || this._deathTime + this._maxDownDuration < Time.time)
         {
             Debug.Log("killed player");
             PlayerRespawnMP.KillPlayer();
             this._vrRespawnActive = false;
         }
     }
     else if (this._manualRespawnTime + this._respawnDuration < Time.time)
     {
         this.Respawn();
         this._vrRespawnActive = false;
     }
     Scene.HudGui.MpRespawnMaxTimer.fillAmount = Mathf.Clamp01((Time.time - this._deathTime) / this._maxDownDuration);
 }
Esempio n. 2
0
 private void Update()
 {
     if (!Scene.Cams.DeadCam.activeSelf)
     {
         if (!Scene.HudGui.MpRespawnLabel.gameObject.activeSelf && this._deathTime + this._minDownDuration < Time.time)
         {
             Scene.HudGui.MpRespawnLabel.gameObject.SetActive(true);
         }
         else if ((TheForest.Utils.Input.GetButtonDown("Take") && Scene.HudGui.MpRespawnMaxTimer.gameObject.activeSelf) || this._deathTime + this._maxDownDuration < Time.time)
         {
             UnityEngine.Debug.Log("killed player");
             PlayerRespawnMP.KillPlayer();
         }
     }
     else if (this._manualRespawnTime + this._respawnDuration < Time.time)
     {
         this.Respawn();
     }
     Scene.HudGui.MpRespawnMaxTimer.fillAmount = Mathf.Clamp01((Time.time - this._deathTime) / this._maxDownDuration);
 }