34 lines
785 B
C#
34 lines
785 B
C#
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}");
|
|
}
|
|
}
|
|
}
|