using UnityEngine;
public class Test_TextAsset : MonoBehaviour {
[SerializeField]
private TextAsset heightDatas;
private void Awake() {
string[] textInLines = heightDatas.text.Split('\n');
for (int i = 1; i < textInLines.Length; i++) {
string[] values = textInLines[i].Split(",");
string name = values[0];
int age = int.Parse(values[1]);
float height = float.Parse(values[2]);
Debug.Log("name=" + name + ", age=" + age + ", height=" + height);
}
}
}
public class Test_TextAsset : MonoBehaviour {
[SerializeField]
private TextAsset heightDatas;
private void Awake() {
string[] textInLines = heightDatas.text.Split('\n');
for (int i = 1; i < textInLines.Length; i++) {
string[] values = textInLines[i].Split(",");
string name = values[0];
int age = int.Parse(values[1]);
float height = float.Parse(values[2]);
Debug.Log("name=" + name + ", age=" + age + ", height=" + height);
}
}
}