- Home /
Text file didnt work in android phone,Textfile didnt work on android phone
i use the way of load map from text file for my game, but when i use unity or build file for PC, it is OK, but when i build APK file, it just load the 1st row of Brick, please help me.
private string[] ReadLevelText() { TextAsset bindData = Resources.Load("Level") as TextAsset;
string data = bindData.text.Replace(Environment.NewLine, string.Empty);
return data.Split('\n');
}
My text file content:
441444144441111111111
141414141141111111111
141414141141111111111
141414141141111111111
141414141141111111111
141414141141111111111
141414141141111111111
144414441144111111111
111111111111111111111,I use the way of load map from text file for my game, but when i use unity or build file for PC, it is OK, but when i build APK file, it just load the 1st row of Brick, please help me.
private string[] ReadLevelText() { TextAsset bindData = Resources.Load("Level") as TextAsset;
string data = bindData.text.Replace(Environment.NewLine, string.Empty);
return data.Split('\n');
}
Below is my text file:
441444144441111111111
141414141141111111111
141414141141111111111
141414141141111111111
141414141141111111111
141414141141111111111
141414141141111111111
144414441144111111111
111111111111111111111
Your answer
Follow this Question
Related Questions
"CommandInvokationFailure: Gradle build failed" when building to Android 1 Answer
APK works but AAB doesn't. libmain.so not found 1 Answer
CommandInvokationFailure: Failed to re-package resources. 0 Answers
Export to android: CommandInvokationFailure: Failed to build apk. 1 Answer
File.ReadAllLines from .txt file in an android build, how does it work? 0 Answers