Example #1
0
    // Look for existing save file in the Save Files document and change save buttons accordingly
    public void CheckForSaveFile()
    {
        var path = Application.persistentDataPath;

        for (int i = 1; i < 4; i++)
        {
            if (File.Exists(path + i))
            {
                var    button          = MainMenuManager.Instance.saveMenu.saveButtons[i - 1];
                var    currentSaveFile = XMLFilHelper.LoadFile(path + i, typeof(SaveFileTemplate)) as SaveFileTemplate;
                string buttonText      = "Name : " + currentSaveFile.Name + "\n" + GetDifficultyString();
                UIUtilities.ChangeButtonVisual(button, saveButtonColors);
                UIUtilities.RenameButton(button, buttonText, TextAnchor.MiddleCenter, 18);
            }
        }
    }