Example #1
0
        private void RpcClientPlayerDie(string killerPlayer)
        {
            try
            {
                //Disable the collider, or the Char controller
                if (isLocalPlayer)
                {
                    //Disable the HUD
                    uiManager.SetHud(false);
                    uiManager.SetDeathScreen(GameManager.GetPlayer(killerPlayer), true);
                }

                //Disable movement
                playerMovementManager.enabled = false;

                foreach (GameObject toDisable in disableGameObjectsOnDeath)
                {
                    toDisable.SetActive(false);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Something went wrong in {MethodName}!", nameof(RpcClientPlayerDie));
            }
        }
Example #2
0
        private void RpcClientPlayerDie()
        {
            try
            {
                playerMovementManager.DisableStateHandling();

                //Disable the collider, or the Char controller
                if (isLocalPlayer)
                {
                    //Switch cams
                    GameManager.GetActiveSceneCamera().SetActive(true);

                    //Disable the HUD
                    uiManager.SetHud(false);
                }

                //Disable movement
                playerMovementManager.enabled = false;
                characterController.enabled   = false;

                foreach (GameObject toDisable in disableGameObjectsOnDeath)
                {
                    toDisable.SetActive(false);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Something went wrong in {MethodName}!", nameof(RpcClientPlayerDie));
            }
        }