So, I have a GUI Textfield for the user to input his or her name which works just fine on the editor but does not on the Android Build.
The text can be perfectly changed in the Editor:
But unlike in the editor, when I build the APK and launch my app in my android device, it all happens like this:
1- I click the textfield and the Android keyboard automatically pops up.
2- I write the name and the textfield DOES change
3- I click done on the Android Keyboard
4- The text changes back to "Name" which means the string doesn't get stored?
Oh and the font that I set on my GUI Skin doesn't work on Android build neither.
The code is relatively simple:
void OnGUI(){
GUI.skin = StandardStyle;
if (AllowGUI) {
if (PlayerPrefs.GetInt ("Language") == 0) {
Name = GUI.TextField (new Rect (Screen.width / 6.69230f, Screen.height / 2.26818f, 340, 50), Name, 15);
CompanyName = GUI.TextField (new Rect (Screen.width / 6.69230f, Screen.height / 1.71f, 340, 50), CompanyName, 25);
}else if(PlayerPrefs.GetInt ("Language") == 1){
Name = GUI.TextField (new Rect (Screen.width / 6.69230f, Screen.height / 2.0818f, 340, 50), Name, 15);
CompanyName = GUI.TextField (new Rect (Screen.width / 6.69230f, Screen.height / 1.61f, 340, 50), CompanyName, 25);
}
}
}