コード例 #1
0
 public Settings_save(Settings_save settings, float newWPM, bool newAutoMode, bool newWordCount)
 {
     scene       = settings.scene;
     WPM         = newWPM;
     autoMode    = newAutoMode;
     doubleWords = newWordCount;
 }
コード例 #2
0
 public SaveFile(Position_Save positions, Player_save player, Backpack_Save backpack, Settings_save settings)
 {
     this.positions = positions;
     this.player    = player;
     this.backpack  = backpack;
     this.settings  = settings;
 }
コード例 #3
0
 public void ReturnSelectOptions()
 {
     SaveSystem.OverrideSettings(currentSaveSettings, "/checkpoint_SettingsSave.test" + saveFileInt.ToString(), WPM, automode, doubleWords);
     canPushButtons      = false;
     currentSaveSettings = SaveSystem.LordSettings("/checkpoint_SettingsSave.test" + saveFileInt);
     a.CloseOptiones();
 }
コード例 #4
0
    public static SaveFile GetSaveFile(int SaveFile)
    {
        Position_Save positons = loadPostion("/checkpoint_SavePosition.test" + SaveFile.ToString());
        Player_save   player   = loadPlayerFile("/checkpoint_SavePlayer.test" + SaveFile.ToString());
        Backpack_Save backpack = loadBackpackFile("/checkpoint_BackpackSave.test" + SaveFile.ToString());
        Settings_save settings = LordSettings("/checkpoint_SettingsSave.test" + SaveFile.ToString());
        SaveFile      file     = new SaveFile(positons, player, backpack, settings);

        return(file);
    }
コード例 #5
0
    public static void OverrideSettings(string newString, string savePostion, float WPM, bool autoMode, bool doubleWords)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + savePostion;
        FileStream      stream    = new FileStream(path, FileMode.Create);

        Settings_save data = new Settings_save(newString, WPM, autoMode, doubleWords);

        formatter.Serialize(stream, data);
        stream.Close();
    }
コード例 #6
0
    public static void SaveSettings(Settings settings, string savePostion)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + savePostion;
        FileStream      stream    = new FileStream(path, FileMode.Create);

        Settings_save data = new Settings_save(settings);

        formatter.Serialize(stream, data);
        stream.Close();
    }
コード例 #7
0
ファイル: Settings.cs プロジェクト: Koolschrank/TypingGame
    public void OverRideSetting(string _saveString)
    {
        Settings_save _save = SaveSystem.LordSettings(_saveString);

        if (_save == null)
        {
            return;
        }
        _scene         = _save.scene;
        WPM            = _save.WPM;
        autoMode       = _save.autoMode;
        doublWordCount = _save.doubleWords;
    }
コード例 #8
0
 public void GetSelectFileAction()
 {
     MTE.SetFileName("Savefile " + (saveFileInt + 1).ToString());
     canPushButtons = false;
     a.OpenFile(saveFileInt);
     currentSaveSettings = SaveSystem.LordSettings("/checkpoint_SettingsSave.test" + saveFileInt);
     if (currentSaveSettings == null)
     {
         noSafe = true;
         MTE.SetActionUI(false);
     }
     else
     {
         noSafe = false;
         MTE.SetActionUI(true);
     }
 }
コード例 #9
0
    public static Settings_save LordSettings(string savePostion)
    {
        string path = Application.persistentDataPath + savePostion;

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);
            Settings_save   data      = formatter.Deserialize(stream) as Settings_save;
            stream.Close();
            return(data);
        }
        else
        {
            Debug.Log("what?");
            return(null);
        }
    }