예제 #1
0
        /// <summary>
        /// On complete download, Save CSV
        /// </summary>
        /// <param name="asyncOperation"></param>
        static void OnCompleteDownload(AsyncOperation asyncOperation)
        {
            //do only if there are not errors
            if (www.isHttpError || www.isNetworkError)
            {
                return;
            }

            //save CSV
            ManageCSV.SaveFile(www.downloadHandler.text);
        }
예제 #2
0
        void ButtonDeleteFileAndDirectory()
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();

            //button to delete file
            if (GUILayout.Button("Delete File"))
            {
                ManageCSV.DeleteFile();
            }

            EditorGUILayout.Space();

            //button to delete directory
            if (GUILayout.Button("Delete Directory"))
            {
                ManageCSV.DeleteDirectory();
            }

            EditorGUILayout.Space();
            EditorGUILayout.EndHorizontal();
        }
예제 #3
0
        void SelectItemToLoad()
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();

            //create options with name of every item in the list
            string[] optionsList = new string[csvData.StructCSV.Count];
            for (int i = 0; i < csvData.StructCSV.Count; i++)
            {
                //check every next element in the list
                for (int j = i + 1; j < csvData.StructCSV.Count; j++)
                {
                    //if same name already in the list, change it to not have duplicates (because EditorGUILayout.Popup doesn't show duplicates - and now name is used also in LoadFile(string name))
                    while (csvData.StructCSV[i].StructName.Equals(csvData.StructCSV[j].StructName))
                    {
                        csvData.StructCSV[i].StructName += "#";
                    }
                }

                optionsList[i] = csvData.StructCSV[i].StructName;
            }

            //show every item
            data.IndexStruct = EditorGUILayout.Popup(data.IndexStruct, optionsList);

            EditorGUILayout.Space();

            //button load songs
            if (GUILayout.Button("Load CSV"))
            {
                data.ParseClass.DefaultCSV      = ManageCSV.LoadFile(data.IndexStruct);
                data.ParseClass.ParsedCSV       = null;
                data.ParseClass.ArraysParsedCSV = null;
            }

            EditorGUILayout.Space();
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
        }