/// <summary> /// Freeze the UFPS player (i.e., gameplay) and show the cursor. /// </summary> public void Freeze() { if (fpPlayerEventHandler != null) { fpPlayerEventHandler.Attack.Stop(); } if (fpController != null) { fpController.SetState("Freeze", true); fpController.Stop(); } wasCrosshairVisible = (fpCrosshair != null) && fpCrosshair.enabled; if (fpCrosshair != null) { fpCrosshair.enabled = false; } if (fpCamera != null) { fpCamera.SetState("Freeze", true); } if (fpInput != null) { fpInput.enabled = false; } if (hideHUD && (fpHUD != null)) { fpHUD.enabled = false; } StartCoroutine(ShowCursorAfterOneFrame()); }
/// <summary> /// moves the controller to a coordinate in one frame and /// freezes movement and optionally camera input /// </summary> public void FreezePlayer(Vector3 pos, Vector2 startAngle, bool freezeCamera) { m_UnFreezePosition = Controller.transform.position; Teleport(pos, startAngle); Controller.SetState("Freeze", true); Controller.Stop(); if (freezeCamera) { Camera.SetState("Freeze", true); } }