Exemplo n.º 1
0
        } //END CreateCSVData

        //-----------------------------------------------//
        private void FindCSVSuccess( string csvText )
        //-----------------------------------------------//
        {

            if( csvText != null && csvText != "" )
            {
                //Store the CSV data file in our local storage
                string csvPath = Application.persistentDataPath + "/" ;

                //Create the scriptable object that will store the data of the CSV file
                CSVData csvData = ScriptableObject.CreateInstance<CSVData>();

                //Store the original data
                csvData.originalCSVText = csvText;
                csvData.rawCSV_original = CSVReader.SplitCsvGrid( csvText );

                //Grab the headers from the CSV data
                csvData.headers = CSVReader.GetHeaders( csvData.rawCSV_original );

                //Setup the columns from the headers
                csvData.AddColumnsFromHeaders();

                csvData.InitLength();

                if( OnSuccess != null )
                {
                    OnSuccess.Invoke( csvData );
                }

            }
            else
            {
                FindCSVFailed();
            }

        } //END FindCSVSuccess