Beispiel #1
0
 public void DeleteHighScores()
 {
     if (QuickSaveRoot.Exists("HighScoreFile"))         //check if the file exists
     {
         QuickSaveRoot.Delete("HighScoreFile");         //if the file exists, then delete it
         print("Deleted data file " + "HighScoreFile"); //send a message that the file was deleted
     }
     else
     {
         print("Nothing to delete"); //if no save file exists, send a message that nothing was done
     }
 }
Beispiel #2
0
 public void DeleteResourceAndUpgradeSaveFile()
 {
     if (QuickSaveRoot.Exists(resourceAndUpgradeDataSaveFileName))         //check if the file exists
     {
         QuickSaveRoot.Delete(resourceAndUpgradeDataSaveFileName);         //if the file exists, then delete it
         print("Deleted data file " + resourceAndUpgradeDataSaveFileName); //send a message that the file was deleted
     }
     else
     {
         print("Nothing to delete"); //if no save file exists, send a message that nothing was done
     }
 }
Beispiel #3
0
    public void RunTutorial()
    {
        if (QuickSaveRoot.Exists("TutorialFile"))
        {
            QuickSaveRoot.Delete("TutorialFile");
        }

        if (QuickSaveRoot.Exists("tutorialResourceAndUpgradeDataSaveFile"))
        {
            QuickSaveRoot.Delete("tutorialResourceAndUpgradeDataSaveFile");
        }
        StartCoroutine(MakeSceneTransition(2));
    }
Beispiel #4
0
    public void SaveHighScores()
    {
        if (QuickSaveRoot.Exists("HighScoreFile"))
        {
            QuickSaveRoot.Delete("HighScoreFile"); //if the file exists, then delete it
        }

        string nameForScore;

        if (uiController.NameTextDisplay.text != null)
        {
            if (uiController.NameTextDisplay.text.Length > 3)
            {
                nameForScore = uiController.NameTextDisplay.text.Substring(0, 3);
            }
            else
            {
                nameForScore = uiController.NameTextDisplay.text;
            }
        }
        else
        {
            nameForScore = "AAA";
        }

        highScoreObjectList.Add(new HighScoreObject(nameForScore, Resources));
        highScoreObjectList.Sort();
        highScoreObjectList.Reverse();
        if (highScoreObjectList.Count > 10)
        {
            highScoreObjectList.RemoveAt(highScoreObjectList.Count - 1);
        }
        foreach (HighScoreObject highScoreObject in highScoreObjectList)
        {
            Debug.Log("The High score for " + highScoreObject.scoreString + " is " + highScoreObject.scoreValue);
        }

        QuickSaveWriter instWriter = QuickSaveWriter.Create("HighScoreFile"); //create an instance of the QuickSaveWriter

        instWriter.Write <List <HighScoreObject> >("HighScoreObjectList", highScoreObjectList);
        instWriter.Commit();//write the save file
    }
Beispiel #5
0
    public void DeleteSave()
    {
        if (QuickSaveRoot.Exists(mapSaveName))
        {
            QuickSaveRoot.Delete(mapSaveName);
            print("Deleted data file " + mapSaveName);
        }
        else
        {
            print("No map to delete");
        }

        if (QuickSaveRoot.Exists(resourcesSaveName))
        {
            QuickSaveRoot.Delete(resourcesSaveName);
            print("Deleted data file " + resourcesSaveName);
        }
        else
        {
            print("No resources to delete");
        }
    }