public void DeleteMap()
 {
     if (selectedSavedGame != null)
     {
         GameplayData.Delete(selectedSavedGame.saveName);
         ClearGrid();
         FetchGrid();
         selectedSavedGame = null;
     }
 }
    private void FetchGrid()
    {
        savedGames = GameplayData.GetMapsInDirectory();

        Debug.Log("maps count in directory -> " + savedGames.Length);

        for (int i = 0; i < savedGames.Length; i++)
        {
            Button            button       = Instantiate(buttonPrefab, grid).GetComponent <Button>();
            SavedGameSelector gameSelector = button.gameObject.AddComponent <SavedGameSelector>();
            gameSelector.saveName     = savedGames[i];
            gameSelector.loadGameMenu = this;
        }
    }
 public void SelectSavedGame(SavedGameSelector savedGame)
 {
     selectedSavedGame = savedGame;
 }