public static bool TextFileExists(string path)
{
if (path.StartsWith("Assets/Resources/"))
{
var pattern = @"(Assets/Resources/)([^.]*)(\..*)";
path = Regex.Replace(path, pattern, "$2");
return Resources.Load(path) as TextAsset != null;
}
else
{
return File.Exists(path);
}
}