Unity3d UNITY尝试使用Oculus VR集成输入(OVRinput)触发CustomEvent
当我从Oculus Touch控制器获得输入时,我想转换targetObject。如果我直接做,它会工作,但当我试图触发CustomEvent时,它不会工作。(我没有Oculus链接,所以我正在耳机上测试)。我正在努力让它和博尔特一起工作,也许这就是问题所在Unity3d UNITY尝试使用Oculus VR集成输入(OVRinput)触发CustomEvent,unity3d,controller,oculus,quest,Unity3d,Controller,Oculus,Quest,当我从Oculus Touch控制器获得输入时,我想转换targetObject。如果我直接做,它会工作,但当我试图触发CustomEvent时,它不会工作。(我没有Oculus链接,所以我正在耳机上测试)。我正在努力让它和博尔特一起工作,也许这就是问题所在 using System.Collections.Generic; using System.Collections; using UnityEngine; using OVRTouchSample; using System; using
using System.Collections.Generic;
using System.Collections;
using UnityEngine;
using OVRTouchSample;
using System;
using Bolt;
public class MyControllerMapping : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
var targetObject = GameObject.Find("ControllerMappingTestObject");
if (OVRInput.GetDown(OVRInput.Button.One))
{
CustomEvent.Trigger(targetObject, "A"); //Doesn't work
}
if (OVRInput.GetDown(OVRInput.Button.One))
{
targetObject.transform.Translate(Vector3.up * Time.deltaTime); //works!
}
}
}
为了正确运行螺栓,需要进行AOT预构建。现在它可以工作了。我又做了一点实验,结果证明,推到耳机上的版本中的Bolt不起作用。我仍然需要帮助,因为我不知道为什么它不起作用