Пример #1
0
    public void OnHit()
    {
        if (!_server || !_server.PlayerCanMove || !_view.IsMine)
        {
            return;
        }

        if (_hasShield)
        {
            PhotonNetwork.Instantiate("HitShieldParticle", transform.position, transform.rotation);
            return;
        }

        _currentLife--;

        if (_currentLife <= 0)
        {
            PhotonNetwork.Instantiate("ExplotionPlayer", transform.position, transform.rotation);
            RequestActivateObject(false);
            _server.SetLooser(this);
        }
        else
        {
            PhotonNetwork.Instantiate("ExplotionAst", transform.position, transform.rotation);
        }
    }