- #if UNITY_ANDROID
- IEnumerator Start()
- {
- string fullName = "jar:file://" + Application.dataPath + "!/assets/test.txt";
- WWW www = new WWW(fullName);
- yield return www;
- //加载完成后处理,有点delay
- print(www.text)
- }
- #else
- void Start ()
- {
- //Windows处理
- }
- #endif
前提是需要把test.txt需要放在 Assets\StreamingAssets\test.txt
|