using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;//自己寫的
public class mycode : MonoBehaviour
{
public SteamVR_Action_Boolean trigger;///按下按鈕出現數值
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (trigger.GetState(SteamVR_Input_Sources.Any)
{
print("yes");///當手把按下按鈕出現yes
}
}
}
按下扣板機會不斷生成球
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;//自己寫的
public class mycode : MonoBehaviour
{
public SteamVR_Action_Boolean trigger;///按下按鈕出現數值
public GameObject mySphere;
public GameObject mySphere;
// Start is called before the first frame update
void Start()
{
}
FLOAT X=0;
FLOAT X=0;
// Update is called once per frame
void Update()
{
if (trigger.GetState(SteamVR_Input_Sources.Any)
{
print("yes");///當手把按下按鈕出現yes
}
GameObject now= Instantiate(mySphere);
now.transform.position =new Vector3(x,0,0);偵測手把位置並在偵測處生成出一顆球
GameObject now= Instantiate(mySphere);
now.transform.position =new Vector3(x,0,0);偵測手把位置並在偵測處生成出一顆球
}
}
比較可惜的是我們小組始終沒有成功
沒有留言:
張貼留言