Пример #1
0
 //call on server
 public void Respawn()
 {
     _dead = false;
     if (_playerMovement != null)
     {
         _playerMovement.SetCanMove(true);
         RespawnPoint[] respawns = FindObjectsOfType <RespawnPoint>();
         for (int i = 0; i < respawns.Length; i++)
         {
             if (respawns[i].faction == playerFaction && respawns[i].isAvailable)
             {
                 respawns[i].isAvailable = false;
                 _playerMovement.RpcForcePosition(respawns[i].transform.position);
                 break;
             }
         }
     }
     if (_playerFire != null)
     {
         _playerFire.SetDead(false);
     }
     if (_playerCamera != null)
     {
         _playerCamera.SetDead(false);
     }
     if (_playerLife != null)
     {
         _playerLife.SetIsDead(false);
         _playerLife.RefillFullLife();
     }
 }