备份CatanBuilding瘦身独立工程
This commit is contained in:
33
Assets/Scripts/EventPinball/PinballUtils.cs
Normal file
33
Assets/Scripts/EventPinball/PinballUtils.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public static class PinballUtils
|
||||
{
|
||||
public static void ExportToCSV(List<string> list, string filePath)
|
||||
{
|
||||
if (list == null || list.Count == 0)
|
||||
{
|
||||
Debug.LogWarning("数据为空,无法导出 CSV 文件。");
|
||||
return;
|
||||
}
|
||||
|
||||
using (StreamWriter sw = new StreamWriter(filePath, true))
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
sw.WriteLine(item);
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log($"CSV 文件已保存到: {filePath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user