- Home /
How to open file csv in localdisk at runtime scene as data resources?
Hi, I've tried to use EditorUtility.OpenFilePanel in Unity example from https://docs.unity3d.com/ScriptReference/EditorUtility.OpenFilePanel.html to open file in csv, but I don't understand how to change the texture 2D into csv file and load it as data resources that doesn't appear in the scene, but the data in csv file will be parse to separate each function. this is my error code :(
[MenuItem("Load data File")]
static void Apply(){
File Choosefile = Selection.Contains as string;
if (Choosefile == null) {
EditorUtility.DisplayDialog ("Select File", "You must select file first", "OK");
return;
}
string pathh = EditorUtility.OpenFilePanel ("Overwrite with csv", "", "csv");
if (pathh.Length != 0) {
WWW www = new WWW ("file:///" + pathh);
www.ToString ();
}
}
void Start () { Locations=new Vector3[filelines.Length]; Rotasi=new Vector3[filelines.Length]; for(i=0; i < filelines.Length;i++){ data_bagian=filelines[i].Split(","[0]); if (data_bagian.Length == 31) { waktu = (float)(float.Parse (data_bagian [0])); gps = (int)(float.Parse (data_bagian [1])); latitude_x = (float)(float.Parse (data_bagian [2])); longitude_y = (float)(float.Parse (data_bagian [3])); altitude = (float)(float.Parse (data_bagian [4])); . . . .
kind of like this... thanks
Your answer
Follow this Question
Related Questions
Multiple Lists to CSV in C# 0 Answers
Parsing a CSV load from server 1 Answer
How do i open an hmtl file located on my project folder? 1 Answer
How to open a .unity3d file 1 Answer