我一直在尝试检索Resources文件夹中的目录(资产 - >资源 - > DiscoveryPage - > Bloggers - > 我想要的各种文件夹),以及它仅适用于运行时的Unity Editor,但不适用于我的Android设备。
以下是我所拥有的:
var input = "5/31/2016, 2:23:33 PM";
var result = moment(input);
console.log(result.format("hh:mm a"));
//output: 02:23 pm
该行:
if (Application.platform == RuntimePlatform.Android) {
//discoveryDir = new DirectoryInfo(Application.dataPath + "/Resources/DiscoveryPage/Bloggers");
//discoveryDir = new DirectoryInfo(Application.persistentDataPath + "/Resources/DiscoveryPage/Bloggers");
discoveryDir = new DirectoryInfo("jar:file://" + Application.dataPath + "!/assets" + "/Resources/DiscoveryPage/Bloggers");
MainUI.ShowDebug("Running on Android. @" + discoveryDir.Name);
} else {
discoveryDir = new DirectoryInfo(Application.dataPath + "/Resources/DiscoveryPage/Bloggers");
}
bloggerDirs = discoveryDir.GetDirectories();
if (bloggerDirs == null)
MainUI.ShowDebug("bloggerDirs is null");
else
MainUI.ShowDebug("bloggerDirs is NOT null");
确实显示了正确的信息(我能够访问Bloggers文件夹并获取discoveryDir.Name,但
MainUI.ShowDebug("Running on Android. @" + discoveryDir.Name);
bloggerDirs并没有返回任何内容(甚至不是null)。调试行都没有打印出来。
似乎像discoveryDir.GetDirectories();在Android上不起作用。
任何人都知道问题以及如何在Android运行时获取这些目录?