コード例 #1
0
    public void OkButtonClicked()
    {
        mapSFX.PlayMapSoundSFX(MapSFX.MapSoundEffect.ButtonPress);
        MapData mapData = FindObjectOfType <MapData>();

        if (currentSquare.GetIsGoal() && !mapData.GetHasGoalBeenReached())
        {
            mapData.SetWasPlayerOnGoalBeforeCombat(true);
        }
        else if (currentSquare.GetIsExtraction())
        {
            mapData.SetWasPlayerOnExtractionBeforeCombat(true);
        }
        mapData.StartBattleIfEnemyExists(currentSquare);

        if (goalAfterTrap)
        {
            mapConfig.GetGoalWindow().OpenGoalWindow(currentSquare);
        }
        else if (extractAfterTrap)
        {
            mapConfig.GetExtractionWindow().OpenExtractionWindow();
        }
        else
        {
            FindObjectOfType <MapConfig>().SetIsAMenuOpen(false);
        }
        gameObject.SetActive(false);
    }