コード例 #1
0
        } //END CallDownloadCSVFileEvent

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

            if( csvText != null && csvText != "" )
            {
                //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( onDownloadCSVCompleted != null ) { onDownloadCSVCompleted.Invoke( csvData ); }

            }
            else
            {
                DownloadFailed();
            }
            
        } //END CSVDownloadSuccess
コード例 #2
0
ファイル: CSVDataManager.cs プロジェクト: contrejo27/Jose
        } //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