CSV(逗号分隔值文件格式):以纯文本形式存储表格数据。
1.挂载脚本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class RWCsv : MonoBehaviour
{
public string fileName;
public List<Student> books = new List<Student>();
// Start is called before the first frame update
void Start()
{
//文件位置
string filePath = Application.streamingAssetsPath + "/" + fileName + ".csv";
//判断目录是否存在
if(!Directory.Exists(Application.streamingAssetsPath))
{
//创建目录
Directory.CreateDirectory(Application.streamingAssetsPath);
}
StreamWriter sw = new Strea