Question by
jpalmer999 · Sep 20, 2018 at 11:26 AM ·
c#android2dprogramming
Android detection not detected by android phone
As the title suggests I am trying to make a game where I have 3 buttons on the screen for movement with a phone user. Without the if statement there it works fine on my phone, however, when the if statement is put there the game does not detect android running on my phone.
Unity Version: 2017.3.1f1
Any help would be greatly appreciated, Jonathan
Code Sample:
public Button btn_left;
public Button btn_right;
public Button btn_jump;
public Text debug;
void Start ( )
{
if (Application.platform == RuntimePlatform.Android)
{
debug.text = "ANDROID";
btn_left.enabled = true;
btn_right.enabled = true;
btn_jump.enabled = true;
btn_left.onClick.AddListener ( TaskOnClickLeft );
btn_right.onClick.AddListener ( TaskOnClickRight );
btn_jump.onClick.AddListener ( TaskOnClickJump );
}
}
Comment
Your answer
Follow this Question
Related Questions
Game working in pc but not in Android While Testing 0 Answers
Trying to move UI Elements but they are not working 1 Answer
Object with rigidbody2D doesn't move when it's supposed to, 0 Answers
Making a list of images within a scrollrect generated from prefabs tappable/clickable 1 Answer
How to make a system in unity 0 Answers