// Pause the game (show the 'pause' panel) public void DoPause() { //call the ShowPausePanel function of the ShowPanels script showPanels.TogglePanel(PanelsManager.PanelNames.PAUSE, true); manager.isPaused = true; manager.showMouse(); if (!manager.isMultiplayer) { //Set time.timescale to 0, this will cause animations and physics to stop updating Time.timeScale = 0; } }
// Display a text with time public void DisplayText(string text, int time = 5, GameObject trigger = null) { // Check if we already show something or not if (!isShowing) { panelScript.TogglePanel(PanelsManager.PanelNames.TEXT, true); } if (trigger) { // If we had a trigger, destroy it after the text is changed Destroy(trigger); } // Change the text to new value theText.text = text; // Set the counter to time remaining counter = (float)time; }