- Home /
Public Array of Files that can be assigned via Inspector
I need my script to know a few paths to .csv-Files. Since it is possible to declare an public array of GameObjects and just drag and drop these Objects into the Array via the inspector, I wondered if I could do something like this with my .csv-Files.
Doing something like
public File[] csvFiles;
doesn't work. Any ideas? Don't know if it is even possible...
Answer by superpig · Jul 04, 2014 at 12:26 PM
Try
public TextAsset[] csvFiles;
You might need to rename your csv files to .txt for Unity to understand what they are, though.
yeah File type is not show in inspector. Use that textasset array or a string array and store the location of the csv files.
Your answer
Follow this Question
Related Questions
Public string/GameObject not in inspector 1 Answer
is there a way to change the public inspector details at runtime 1 Answer
Avoid public variable to get overwritten by the Inspector 1 Answer
How to check if a public method is referenced in inspector 3 Answers
How to set a public variable to a gameObject in the inspector through coding 1 Answer