使用www加载资源,无论是在PC端还是移动端都要在路径前面加“file://”
例如:
/// <summary>
/// 本地存储路径
/// </summary>
public static string WWWPathURL
{
get
{
string path = "";
if (Application.platform == RuntimePlatform.Android)
path = "file://" + Application.persistentDataPath + "/";
else if (Application.platform == RuntimePlatform.IPhonePlayer)
path = "file://" + Application.persistentDataPath + "/";
else if (Application.platform == RuntimePlatform.WindowsEditor)
path = "file:///" + Application.streamingAssetsPath + "/";
return path;
}
}

395

被折叠的 条评论
为什么被折叠?



