private void OnPauseMenuClosed() { Cursor.lockState = CursorLockMode.Locked; PlayerMovement playerMovement = GetComponent <PlayerMovement>(); ThirdPersonCamera thirdPersonCamera = GetComponent <ThirdPersonCamera>(); Spellcasting spellcasting = GetComponent <Spellcasting>(); Dancing dancing = GetComponent <Dancing>(); if (playerMovement != null && !networkGamePlayerMageBall.IsFrozen) { playerMovement.enabled = true; } if (dancing != null) { dancing.enabled = true; } if (thirdPersonCamera != null) { thirdPersonCamera.enabled = true; } if (spellcasting != null && !networkGamePlayerMageBall.IsFrozen) { spellcasting.CmdSetCanCastSpells(true); } }
private void OnPauseMenuOpened() { Cursor.lockState = CursorLockMode.None; PlayerMovement playerMovement = GetComponent <PlayerMovement>(); ThirdPersonCamera thirdPersonCamera = GetComponent <ThirdPersonCamera>(); Spellcasting spellcasting = GetComponent <Spellcasting>(); Animator animator = GetComponent <Animator>(); Dancing dancing = GetComponent <Dancing>(); if (animator != null) { animator.SetFloat("Speed", 0); animator.SetBool("IsJumping", false); } if (playerMovement != null) { playerMovement.ResetSpeed(); playerMovement.enabled = false; } if (dancing != null) { dancing.enabled = false; dancing.StopDancing(); } if (thirdPersonCamera != null) { thirdPersonCamera.enabled = false; } if (spellcasting != null) { spellcasting.CmdSetCanCastSpells(false); } }