我正在使用 Vuforia 开发 Unity。
我有虚拟按钮,我需要像键盘上的向上/向下箭头一样移动不在其图像目标中的对象,所以我正在寻找基础知识。
我的课是这样开始的:
public void OnButtonPressed(VirtualButtonAbstractBehaviour vb){
...
}
我需要在其中添加什么才能使其像向上按钮一样?
如果没有这些虚拟按钮,我的脚本会像这样移动对象:
void FixedUpdate(){
float moveHortizonal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHortizonal, 0, moveVertical);
rigidbody.AddForce (movement * speed);
}