Like I said in this other question that no one has answered:
Touch not working on Unity on my Android device
I discovered that the problem of my app not working was this lines:
if (Application.platform == RuntimePlatform.Android) {
}
If i remove that condition the app works like it should but the moment i add it back it just doensn't work.
Follow you posts, I did an experiment.
First, I try run below code on Remote 5 and run it as an individual app respectively.
On Remote 5 app, the console prints:
On individual app, the console prints:
Apparently, the
Application.platform
is not working as you expected with Unity Remote 5, so your code doesn't work when you put them inside the if statement. Actually, your code would work perfectly without using Remote 5.There are two ways to solve this:
Don't use Unity Remote 5 to test your app. Though it's a pretty handy way to test your game, sometimes it's not working as you expected when you deploy your app to the real device.
Use Platform dependent compilation. I recommend you to use this for develop your game on different platforms. As the RuntimePlatform document suggests:
Here is an example to run your code on only Android platform with platform dependent flag.