コード例 #1
0
        public void LoadCSV(string file_name)
        {
            List <string> files = UnityHelper.FindAssetsWithFilename(file_name + ".csv");

            if (files.Count > 0)
            {
                ParseCSV(FileHelper.ReadFileIntoString(files[0]));
            }
            else
            {
                throw new System.Exception("CVS File with name \"" + file_name + "\" could not be found.");
            }
        }
コード例 #2
0
        private static string[] ResolveFilesToDirectoryFindAllReferneces(string file_sub_path)
        {
            List <string> valid_paths = new List <string>();

            string[] found_paths = UnityHelper.FindAssetsWithFilename(Path.GetFileName(file_sub_path)).ToArray();
            foreach (string p in found_paths)
            {
                if (p.EndsWith(file_sub_path))
                {
                    valid_paths.Add(p);
                }
            }
            return(valid_paths.ToArray());
        }