【发布时间】:2018-12-12 09:58:32
【问题描述】:
我正在使用 SteamVR 开发一个 VR 项目,当使用控制器抓取游戏对象时,我需要特定事件(粒子系统)来启动 我尝试了这段代码(C#)来确定这个游戏对象是否被抓取并且它不能正常工作(它看起来总是正确的)
private Interactable interactable;
public bool isGrabbed=false;
// Use this for initialization
void Start()
{
interactable = this.GetComponent<Interactable>();
}
// Update is called once per frame
void Update()
{
if (interactable != null )
{
isGrabbed = true;
}
}
【问题讨论】:
标签: c# unity3d virtual-reality steam