Пример #1
0
 private void UpdateRespawnPercentage(bool playersOnBeacon)
 {
     if (playersOnBeacon)
     {
         respawnPercentage += respawnRate;
         if (respawnPercentage >= 100f)
         {
             playerStatsController.Respawn();
             StartCoroutine(VfxHelper.CreateVFX(respawnEffectPrefab, transform.position + new Vector3(0, 0.01f, 0), Quaternion.identity, PlayerManager.colours.GetColour(playerStatsController.characterColour)));
             Destroy(gameObject);
         }
     }
     else
     {
         respawnPercentage = Mathf.Max(0, respawnPercentage - 2f * respawnRate);
         if (respawnPercentage <= 0)
         {
             text.text = reviveText;
             return;
         }
     }
     text.text = respawnPercentage.ToString("N0") + "%";
 }