示例#1
0
    public void LaunchGame(int slot)
    {
        // set what save slot will be saved to
        currentSaveSlot = slot;
        switch (slot)
        {
        case 1:
        {
            if (saveSlot1 != null)
            {
                playerStats   = new PlayerStats(saveSlot1);
                restPointRoom = saveSlot1.restPointRoom;
            }
            else         // new save slot
            {
                playerStats   = new PlayerStats();
                restPointRoom = 1;
                SaveLoadSystem.SaveGameData(currentSaveSlot);
            }
            break;
        }

        case 2:
        {
            if (saveSlot1 != null)
            {
                playerStats   = new PlayerStats(saveSlot2);
                restPointRoom = saveSlot2.restPointRoom;
            }
            else         // new save slot
            {
                playerStats   = new PlayerStats();
                restPointRoom = 1;
                SaveLoadSystem.SaveGameData(currentSaveSlot);
            }
            break;
        }

        case 3:
        {
            if (saveSlot1 != null)
            {
                playerStats   = new PlayerStats(saveSlot3);
                restPointRoom = saveSlot3.restPointRoom;
            }
            else         // new save slot
            {
                playerStats = new PlayerStats();
                SaveLoadSystem.SaveGameData(currentSaveSlot);
            }
            break;
        }

        case 4:
        {
            if (saveSlot1 != null)
            {
                playerStats   = new PlayerStats(saveSlot4);
                restPointRoom = saveSlot4.restPointRoom;
            }
            else         // new save slot
            {
                playerStats   = new PlayerStats();
                restPointRoom = 1;
                SaveLoadSystem.SaveGameData(currentSaveSlot);
            }
            break;
        }
        }
        LoadStartingScene(restPointRoom);
        inMenu = false;
    }
示例#2
0
 public void SaveGameData()
 {
     SaveLoadSystem.SaveGameData(this);
 }