【发布时间】:2019-03-12 18:07:42
【问题描述】:
我是虚拟现实的新手。我将 Oculus Rift 用于耳机,使用 Leap Motion 进行交互。当用户用手旋转一个对象时,我希望触发一个特定的事件。
这是我的代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class step1 : MonoBehaviour
{
public GameObject object;
public ParticleSystem event;
void Start()
{
}
// Update is called once per frame
void Update()
{
if(object.transform.rotation == Quaternion.AngleAxis(-30,Vector3.right))
{
Debug.Log("Done");
event.Play();
}
}
}
【问题讨论】:
标签: unity3d virtual-reality oculus leap-motion