コード例 #1
0
    //streamingAssetsPath for release, persistentDataPath for testing
    public void SaveData(List <InputData> inputDatas)
    {
        if (File.Exists(Application.streamingAssetsPath + "/networkData.dat"))
        {
            File.Delete(Application.streamingAssetsPath + "/networkData.dat");
        }

        var bf   = new BinaryFormatter();
        var file = File.Create(Application.streamingAssetsPath + "/networkData.dat");

        var list = new InputDataList
        {
            Data = inputDatas
        };

        bf.Serialize(file, list);
        file.Close();
    }
コード例 #2
0
 // Input Callbacks
 private void OnControlsChanged(InputDataList data)
 {
     Settings.Instance.CurrentControls.Value = data;
     Settings.Instance.ApplyInputSettings();
     UpdateResetSaveButtonState();
 }