コード例 #1
0
    void OnContinueClicked(ClickedAction action)
    {
        // Make time flow again
        Time.timeScale = 1;

        // Lock the cursor
        Cursor.lockState = lockModeOnResume;

        // Hide the panel
        pausePanel.SetActive(false);

        // Indicate change
        if (onVisibleChanged != null)
        {
            onVisibleChanged(action);
            onVisibleChanged = null;
        }
    }
コード例 #2
0
    public void OnContinueClicked(ClickedAction action)
    {
        // Reset the default button
        UnityEngine.EventSystems.EventSystem.current.SetSelectedGameObject(null, null);

        // Make time flow again
        Time.timeScale = 1;

        // Lock the cursor
        Screen.lockCursor = true;

        // Hide the panel
        pausePanel.SetActive(false);

        // Indicate change
        if (msInstance.onVisibleChanged != null)
        {
            msInstance.onVisibleChanged(action);
        }
    }
コード例 #3
0
        void mapControl1_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            MapHitInfo         hitInfo     = MapControl.CalcHitInfo(e.Location);
            MapOverlayItemBase clickedItem = MapOverlayUtils.GetClickedOverlayItem(hitInfo);

            if (clickedItem == null)
            {
                return;
            }
            ClickedAction action = OverlayManager.GetClickedAction(clickedItem);

            switch (action)
            {
            case ClickedAction.NewGame:
                MapInteractiveEnabling(false);
                OverlayManager.ShowNewGameOverlay();
                break;

            case ClickedAction.StartGame:
                GameInit(OverlayManager.GetSelectedLevel());
                break;

            case ClickedAction.FinishGame:
                this.gameCore.FinishGame();
                break;

            case ClickedAction.ShowCountry:
                this.gameCore.ShowCountry();
                break;

            case ClickedAction.SkipCountry:
                this.gameCore.SkipCountry();
                break;
            }
        }
コード例 #4
0
    public void Show(System.Action <PauseMenu> visibleChanged = null)
    {
        // Store function pointer
        onVisibleChanged = visibleChanged;

        // Unlock the cursor
        Cursor.lockState = CursorLockMode.None;

        // Make the game object active
        pausePanel.SetActive(true);

        // Stop time
        Time.timeScale = 0;

        // Indicate we paused
        lastClickedAction = ClickedAction.Paused;

        // Indicate change
        if (onVisibleChanged != null)
        {
            onVisibleChanged(this);
        }
    }