每当用户抓取对象时,我都会覆盖GrabBegin
函数并尝试发出 Post 请求。但看起来请求从未被调用过。吊顶没有错误或警告问题。我也尝试通过使用打印到控制台,Debug.Log("Grab Begin")
但它从未打印到控制台。我不确定我错过了什么。我仍然能够通过 VR 抓取物体
public class AromaShooterGrabbable : OVRGrabbable
{
override public void GrabBegin(OVRGrabber hand, Collider grabPoint) {
base.GrabBegin(hand, grabPoint);
RestClient.Post<AromaShooterResponse>(url, new Post {
duration = 3000,
channel = 1,
intensity = 100
}).Then(response => {
Debug.Log(response.status);
}).Catch(error => {
Debug.Log(error.Message);
});
}
}