using System.Collections; using System.Collections.Generic; using UnityEngine; using Valve.VR; public class bullet : MonoBehaviour { public SteamVR_Action_Boolean myTrigger; public GameObject mybullet; public GameObject myController; float x = 0; bool state = false; // Start is called before the first frame update void Start() {
}
// Update is called once per frame void Update() { if (myTrigger.GetState(SteamVR_Input_Sources.Any)) { if (state == false) { state = true;
using System.Collections; using System.Collections.Generic; using UnityEngine; using Valve.VR;
public class steamVR : MonoBehaviour { public SteamVR_Action_Boolean triggerDown; public SteamVR_Action_Vibration hapticAction; public SteamVR_Action_Single squeezeAction; public SteamVR_Action_Vector2 touchpadTouch; // Start is called before the first frame update void Update() { if (triggerDown.GetState(SteamVR_Input_Sources.Any)) { hapticAction.Execute(0, 1, 150, 75, SteamVR_Input_Sources.LeftHand); print("triggerDown"); } float triggerValue = squeezeAction.GetAxis(SteamVR_Input_Sources.Any); Vector2 padPos = touchpadTouch.GetAxis(SteamVR_Input_Sources.Any);
if (triggerValue > 0.0f) { print(triggerValue); } if (padPos != Vector2.zero) { print(padPos); } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using Valve.VR;
public class steamVR : MonoBehaviour { public SteamVR_Action_Boolean triggerDown; public SteamVR_Action_Vibration hapticAction; public SteamVR_Action_Single squeezeAction; public SteamVR_Action_Vector2 touchpadTouch; // Start is called before the first frame update void Update() { if (triggerDown.GetState(SteamVR_Input_Sources.Any)) { hapticAction.Execute(0, 1, 150, 75, SteamVR_Input_Sources.LeftHand); print("triggerDown"); } float triggerValue = squeezeAction.GetAxis(SteamVR_Input_Sources.Any); Vector2 padPos = touchpadTouch.GetAxis(SteamVR_Input_Sources.Any);
if (triggerValue > 0.0f) { print(triggerValue); } if (padPos != Vector2.zero) { print(padPos); } }