public static string LoadTextFromStreamingAssets(string path) { if (!IsStreamingAssetsExists(path)) { throw new Exception("Not exist StreamingAssets path: " + path); } #if UNITY_ANDROID return(ResAndroidPlugin.GetAssetString(path)); #else return(File.ReadAllText(Path.Combine(Application.streamingAssetsPath, path))); #endif }
public static string ReadAllText(string path) { string fullPath; var getResPathType = GetBundleFullPath(path, out fullPath); if (getResPathType == ResPathType.Invalid) { return(null); } #if UNITY_ANDROID if (getResPathType == ResPathType.InApp) { return(ResAndroidPlugin.GetAssetString(path)); } #endif return(File.ReadAllText(fullPath)); }