public static string LoadTextFromFile(string path)
{
if (path.StartsWith(ResourcePaths.ROOT_RESOURCES))
{
var pattern = @"(Assets/Resources/)([^.]*)(\..*)";
path = Regex.Replace(path, pattern, "$2");
return LoadTextFromResource(path);
}
else if (File.Exists(path))
{
return File.ReadAllText(path);
}
PSDebug.Log("error loading text file from path: {0}", path);
return null;
}