예제 #1
0
    public void OnToggleDialog(bool forceClose)
    {
        bool isBuildingModeDialog = dialogType.Equals(DialogType.BuildingModeDialog);

        GameStore.SetOpenedDialog(dialogType);
        Tooltip.OnHideTooltip();
        // hide dialog
        if (gameObject.activeSelf)
        {
            GameStore.SetOpenedDialog(DialogType.Hidden);
            gameObject.SetActive(false);

            // Toggle off build mode
            if (isBuildingModeDialog)
            {
                GridBuildMode.OnToggleBuildMode();
            }

            return;
        }

        if (!forceClose)
        {
            if (isBuildingModeDialog)
            {
                GridBuildMode.OnToggleBuildMode();
            }
            gameObject.SetActive(true);
        }
    }