/// <summary> /// Set the active state of the items in use and enable the cursor. /// </summary> /// <param name="displayState"> The boolean parameter to set the display state to. </param> void SetActiveUI(bool displayState) { foreach (ThrowableManager throwable in throwables) { throwable.SetButtonActive(displayState); } foreach (KeyManager key in keys) { key.SetImageActive(displayState); } //Enable the cursor. Cursor.visible = displayState; //If inventory is visible, disable camera input and vice versa. if (displayState) { Cursor.lockState = CursorLockMode.None; MoveCamera.DisableInput(); Time.timeScale = 0f; } else { Cursor.lockState = CursorLockMode.Locked; MoveCamera.EnableInput(); Time.timeScale = 1f; } }