2022. 4. 30. 11:46
Unity
https://assetstore.unity.com/packages/tools/integration/csv-serialize-135763
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Demo : MonoBehaviour
{
public Test[] tests;
[System.Serializable]
public class Test
{
public int num = 0;
public string name = "";
}
// Start is called before the first frame update
void Start()
{
var csv = "num,name\n0,\"mom\"\r\n1,dad\n\"2\",\"me\"\n\"3\",\"한국어\"";
tests = CSVSerializer.Deserialize<Test>(csv);
var list = CSVSerializer.ParseCSV(csv);
for (int x = 0; x < list.Count; x++)
{
for (int y = 0; y < list[x].Length; y++)
{
Debug.Log($"[{x}][{y}]{list[x][y]}");
}
}
}
// Update is called once per frame
void Update()
{
}
}
잘된다
'Unity' 카테고리의 다른 글
유니티 창위치 설정 (0) | 2022.06.18 |
---|---|
유니티 차트 (0) | 2022.04.24 |
유니티 Log 확인 에셋 (0) | 2022.04.23 |