Я пробовал так и не работает.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.IO;
using System.Collections.Generic;
public class leitorCSV2 : MonoBehaviour
{
public GameObject cubeTest;
public TextAsset csvFile;
// Update is called once per frame
void Update()
{
readCSV();
}
void readCSV()
{
string[] records = csvFile.text.Split('\n');
for (int i = 1; i < records.Length; i++)
{
string[] fields = records[i].Split(',');
float x = float.TryParse(fields[1], out x) ? x : 0;
float y = float.TryParse(fields[2], out y) ? y : 0;
float z = float.TryParse(fields[3], out z) ? z : 0;
cubeTest.transform.Translate(new Vector3(x, y, z) *
Time.deltaTime);
}
}
}