Open clyptomania opened 4 years ago
for ex.
public class DataPlotter : MonoBehaviour {
// Name of the input file, no extension
public string inputfile;
// List for holding data from CSV reader
private List<Dictionary<string, object>> pointList;
// Use this for initialization
void Start () {
// Set pointlist to results of function Reader with argument inputfile
pointList = CSVReader.Read(inputfile);
//Log to console
Debug.Log(pointList);
}
}
To get Unity to read the CSV, we need to create a folder called Resources under Assets within the Project window. Make sure the naming is exact, since a folder with the name Resources has a special meaning for Unity:
it allows for simple direct references to assets rather than manually associating them in the editor