/// <summary>
 /// ランキングレコードを書き込む
 /// </summary>
 public void WriteRankingRecords(string filePath)
 {
     using (TextWriter w = FuncBox.GetTextWriter(filePath)) {
         for (int i = 0; i < _rankingRecords.Count; i++)
         {
             w.WriteLine(_rankingRecords[i].GetWriteString());
         }
     }
 }
    /// <summary>
    /// 設定ファイル書き込み
    /// </summary>
    protected void WriteSettingFile()
    {
        string path = Application.streamingAssetsPath + "/" + settingFile;

        using (TextWriter w = FuncBox.GetTextWriter(path)) {
            //書き込み文字列の生成
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("<BGMVolume>");
            sb.AppendLine(bgmVolume.ToString());
            sb.AppendLine("<SEVolume>");
            sb.AppendLine(seVolume.ToString());
            sb.AppendLine("<End>");
            //書き込み
            w.Write(sb.ToString());
        }
    }
 /// <summary>
 /// コンフィグファイルを書き込み
 /// </summary>
 public void WriteConfig(string filePath)
 {
     using (TextWriter w = FuncBox.GetTextWriter(filePath)) {
         StringBuilder sb = new StringBuilder();
         sb.AppendLine("<BattleTime>");
         sb.AppendLine(battleTime.ToString());
         sb.AppendLine("<StageScale>");
         sb.AppendLine(stageScale.ToString());
         sb.AppendLine("<GameSpeed>");
         sb.AppendLine(gameSpeed.ToString());
         sb.AppendLine("<PlayerHPScale>");
         sb.AppendLine(playerHPScale.ToString());
         sb.AppendLine("<MaxEnergy>");
         sb.AppendLine(maxEnergy.ToString());
         sb.AppendLine("<EnergyOutput>");
         sb.AppendLine(energyOutput.ToString());
         //書き込み
         w.Write(sb.ToString());
     }
 }
Beispiel #4
0
        /// <summary>
        /// folderPath以下に書き込み
        /// </summary>
        public void Write(string folderPath)
        {
            TextWriter w;

            //ディレクトリ確認
            if (!Directory.Exists(folderPath))
            {
                Directory.CreateDirectory(folderPath);
            }
            //主情報
            using (w = FuncBox.GetTextWriter(folderPath + "/Main.txt")) {
                WriteMain(w);
            }
            //頂点情報
            using (w = FuncBox.GetTextWriter(folderPath + "/Vertex.txt")) {
                WriteVertex(w);
            }
            //三角形インデックス
            using (w = FuncBox.GetTextWriter(folderPath + "/Index.txt")) {
                WriteIndex(w);
            }
        }