コード例 #1
0
ファイル: Pause.cs プロジェクト: dragosthealex/LudumDare36
 // 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;
     }
 }
コード例 #2
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;
    }