Exemplo n.º 1
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));
            }
        }