public override void OnInspectorGUI()
        {
            CSVWranglerStartUp my = (CSVWranglerStartUp)target;

            //EditorGUIUtility.LookLikeControls();
            DrawDefaultInspector();

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Download index file"))
            {
                FileDownloadWindow.Init();

                FileDownloadWindow.instance.AddToDlQueue(my.settings.liveURL, "CSVs/csvWrangler.csv", FileDownloadWindow.DownloadLocation.ResourceFolder);
            }

            if (File.Exists(Application.dataPath + "/Resources/CSVs/csvWrangler.csv") && GUILayout.Button("Download referenced csvs"))
            {
                //open the csvWrangler.csv into deadsimple csv
                DeadSimpleCSV indexTable = new DeadSimpleCSV(File.ReadAllText(Application.dataPath + "/Resources/CSVs/csvWrangler.csv"), true);

                //dump into classlist
                List<CSVWrangler.IndexRow> rows = indexTable.ConvertRowsToObjects<CSVWrangler.IndexRow>();

                FileDownloadWindow.Init();

                foreach (CSVWrangler.IndexRow row in rows)
                {
                    FileDownloadWindow.instance.AddToDlQueue(row.url, "CSVs/" + row.name + ".csv", FileDownloadWindow.DownloadLocation.ResourceFolder);
                }

            }

            EditorGUILayout.EndHorizontal();
        }
Пример #2
0
        public static void Init()
        {
            // Get existing open window or if none, make a new one:
            FileDownloadWindow window = (FileDownloadWindow)EditorWindow.GetWindow(typeof(FileDownloadWindow));

            window.Show();
            window.Focus();
            instance = window;
            //window = window;
        }