Unity 捕捉Android按键

// 返回键
if ( Application.platform == RuntimePlatform.Android &&(Input.GetKeyDown(KeyCode.Escape)))
{
//….
}

// Home键
if ( Application.platform == RuntimePlatform.Android &&(Input.GetKeyDown(KeyCode.Home) ))
{
//…..
}

用法
public void Update()
{
//捕捉安卓返回键
if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape)))
{
gameController.ReturnStartUI();
}
}

你可能感兴趣的:(Unity)