clyptomania / cog-des-datavisualisation

This is the main repo for storing all subject data and unity scripts for visualising data
0 stars 0 forks source link

create a direct reference of CSV file within Unity #5

Open clyptomania opened 4 years ago

clyptomania commented 4 years ago

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

clyptomania commented 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);
 }

}
clyptomania commented 4 years ago

check https://sites.psu.edu/bdssblog/2017/04/06/basic-data-visualization-in-unity-scatterplot-creation/