Exemplo n.º 1
0
    /// <summary>
    /// Sets up the save file information for the save files.
    /// </summary>
    private void SetupSaveFiles()
    {
        saveFiles = new EntryList <SaveFileEntry>(visibleSize);

        for (int i = 0; i < SaveController.SAVE_FILES_COUNT; i++)
        {
            Transform     t     = Instantiate(entryPrefab, listParent);
            SaveFileEntry entry = saveFiles.CreateEntry(t);
            if (chapterIDs[i].value == CLEAR_GAME_ID)
            {
                entry.FillData("All maps cleared!", totalDays[i].value, playTimes[i].value);
            }
            else if (string.IsNullOrEmpty(chapterIDs[i].value))
            {
                entry.FillData("BASE", totalDays[i].value, playTimes[i].value);
            }
            else
            {
                MapEntry map = (MapEntry)chapterLibrary.GetEntry(chapterIDs[i].value);
                if (map != null)
                {
                    entry.FillData(map.entryName, totalDays[i].value, playTimes[i].value);
                }
                else
                {
                    chapterIDs[i].value = "";
                    totalDays[i].value  = 0;
                    playTimes[i].value  = 0;
                    entry.FillData("", 0, 0);
                }
            }
        }
        entryPrefab.gameObject.SetActive(false);
    }
Exemplo n.º 2
0
    public void UpdateFile()
    {
        int           i     = saveFiles.GetPosition();
        SaveFileEntry entry = saveFiles.GetEntry();

        if (chapterIDs[i].value == CLEAR_GAME_ID)
        {
            entry.FillData("All maps cleared!", totalDays[i].value, playTimes[i].value);
        }
        else if (chapterIDs[i].value == "")
        {
            entry.FillData("BASE", totalDays[i].value, playTimes[i].value);
        }
        else
        {
            MapEntry map = (MapEntry)chapterLibrary.GetEntry(chapterIDs[i].value);
            entry.FillData(map.entryName, totalDays[i].value, playTimes[i].value);
        }
    }