在Nibiru系统开发中 手柄等事件都已经封装了,开发的时候只需要继承一下接口就好了
在开发中新建一个脚本 然后添加引用
using Nar.Internal;
然后在后面添加接口
INarButtonListener
选中它 点击实现接口
public void OnFuctionKeyDown(FunctionKeyCode keyCode)
{
throw new System.NotImplementedException();
}
public void OnLiftBack()
{
throw new System.NotImplementedException();
}
public void OnLiftDown()
{
throw new System.NotImplementedException();
}
public void OnLiftFuctionKey(FunctionKeyCode keyCode)
{
throw new System.NotImplementedException();
}
public void OnLiftLeft()
{
throw new System.NotImplementedException();
}
public void OnLiftRight()
{
throw new System.NotImplementedException();
}
public void OnLiftUp()
{
throw new System.NotImplementedException();
}
public void OnPressBack()
{
throw new System.NotImplementedException();
}
public void OnPressDown()
{
throw new System.NotImplementedException();
}
public void OnPressEnter(bool isKeyUp)
{
throw new System.NotImplementedException();
}
public void OnPressLeft()
{
throw new System.NotImplementedException();
}
public void OnPressRight()
{
throw new System.NotImplementedException();
}
public void OnPressUp()
{
throw new System.NotImplementedException();
}
public void OnPressVolumnDown()
{
throw new System.NotImplementedException();
}
public void OnPressVolumnUp()
{
throw new System.NotImplementedException();
}
实现接口之后就会出现这些方法 将你所需要的事件写进去就好了