一般的安卓盒子主要按键包含

1.方向键:上下左右

2.确认

3.返回

4.音量(Unity无法获取),须要在安卓层将事件发上来,KeyCode = 24,25


基本的函数是


if (Input.GetKeyDown(KeyCode.Escape))
   {
        //返回
   }

   if (Input.GetKeyDown(KeyCode.LeftArrow))
   {
        //左
   }
        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            //右
        }
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            //上
        }
        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            //下
        }

//确认键的捕获
        if (Input.GetKeyDown(KeyCode.JoystickButton0))
   {
       //确认
   }

或者:

if (Input.GetKeyDown(KeyCode.Joystick1Button0))
   {
        //确认
   }


一般将这个捕获用在Update()方法内。

我測试的盒子是:爱奇艺的盒子,也就是电信ITV指定的盒子。

相关文章:

  • 2021-11-19
  • 2021-12-08
  • 2021-04-05
  • 2021-09-23
  • 2021-11-14
  • 2021-12-07
  • 2023-01-05
  • 2021-11-18
猜你喜欢
  • 2022-01-10
  • 2022-12-23
  • 2021-06-24
  • 2021-05-03
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案