I want to use the editor to import a bunch of fbx files.
I don’t know how to proceed from the code below…
public class Importer : Editor
{
[MenuItem("Custom/Import Step")]
static void ImportStep()
{
string file_path = "files.csv";
StreamReader inp_stm = new StreamReader(file_path);
while (!inp_stm.EndOfStream)
{
string inp_ln = inp_stm.ReadLine();
string[] a = inp_ln.Split(';');
Debug.Log(a[0]);
string tmp_string = "Assets/" + a[0] +".fbx";
float x = float.Parse(a[1]);
float y = float.Parse(a[2]);
float z = float.Parse(a[3]);
Debug.Log(tmp_string);
//GameObject go = (GameObject)AssetDatabase.LoadAssetAtPath(tmp_string, typeof(GameObject));
//AssetDatabase.LoadAssetAtPath(tmp_string, typeof(GameObject));
//Instantiate(gos*);*
//go.name = “ast.1”;
//go.transform.position = new Vector3(x, y, z);
}
inp_stm.Close();
}
}