Skip to content

Instantly share code, notes, and snippets.

@nipundavid
Last active July 22, 2017 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nipundavid/abe83bfaeed383a0de861e76548b8034 to your computer and use it in GitHub Desktop.
Save nipundavid/abe83bfaeed383a0de861e76548b8034 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class AndroidCallBacks : MonoBehaviour {
private string yes = "0";
private string no = "1";
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void HandleCallBacks(string buttonIndex)
{
Debug.Log(buttonIndex);
if (buttonIndex == yes)
{
GameObject.FindGameObjectWithTag("controller").GetComponent<Controller>().reply.text = "Yes Pressed";
}else if(buttonIndex == no)
{
GameObject.FindGameObjectWithTag("controller").GetComponent<Controller>().reply.text = "No Pressed";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment