// Update is called once per frame
 void Update()
 {
     if (grabbable.isGrabbed && OVRInput.GetDown(vrShootButton, grabbable.grabbedBy.GetController()))
     {
         simpleShoot.TriggerShoot();
     }
 }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     if (OVRInput.GetDown(trigger))
     {
         simpleShoot.TriggerShoot();
     }
 }
예제 #3
0
 // Update is called once per frame
 void Update()
 {
     if (OVRInput.GetDown(shootingButton))
     {
         simpleShoot.TriggerShoot();
     }
 }
예제 #4
0
 // Update is called once per frame
 void Update()
 {
     if (ovrGrabbable.isGrabbed && OVRInput.GetDown(shootButton, ovrGrabbable.grabbedBy.getController()))
     {
         //Shoot
         simpleShoot.TriggerShoot();
     }
 }
예제 #5
0
 // Update is called once per frame
 void Update()
 {
     if (ovrGrabbale.isGrabbed && OVRInput.GetDown(shootingButton, ovrGrabbale.grabbedBy.GetController()) && maxNumberOfBullets > 0)
     {
         //Shoot!!
         simpleShoot.TriggerShoot();
         maxNumberOfBullets--;
         bulletText.text = maxNumberOfBullets.ToString();
     }
 }
예제 #6
0
    private void ProcessTouchpadDown()
    {
        if (!m_CurrentObject)
        {
            return;
        }

        Interactable interactable = m_CurrentObject.GetComponent <Interactable>();

        interactable.Pressed();
        simpleShoot.TriggerShoot();
    }
예제 #7
0
    void Update()
    {
        if (grabbable.isGrabbed && OVRInput.GetDown(shootInput, grabbable.grabbedBy.Controller))
        {
            if (audio)
            {
                audio.Play();
                OVRVibration.Trigger(audio.clip, grabbable.grabbedBy.Controller);
            }

            shootBehaviour.TriggerShoot();
        }
    }
예제 #8
0
    // Update is called once per frame
    void Update()
    {
        if (ovrGrabbable.isGrabbed && OVRInput.GetDown(shootingButton, ovrGrabbable.grabbedBy.GetController()) && maxNumberOfBullets > 0)
        {
            // Shoot!

            VibrationManager.singleton.TriggerVibration(40, 2, 255, ovrGrabbable.grabbedBy.GetController());
            //Trigger Haptic :
            //DONT DO THIS !!! OVRInput.SetControllerVibration(0.5f, 0.5f, ovrGrabbable.grabbedBy.GetController());

            //DO THIS
            GetComponent <AudioSource>().PlayOneShot(shootingAudio);
            simpleShoot.TriggerShoot();
            maxNumberOfBullets--;
            bulletText.text = maxNumberOfBullets.ToString();
        }
    }
예제 #9
0
    // Update is called once per frame
    void Update()
    {
        if (Time.time >= nextTime)
        {
            bulletText.text = DateTime.Now.ToString();
            nextTime       += interval;
        }

        if (ovrGrabbable.isGrabbed && OVRInput.GetDown(shootingButton, ovrGrabbable.grabbedBy.GetController()))
        {
            // Shoot;
            simpleShoot.TriggerShoot();

            FindObjectOfType <AudioManager>().Play("Gun Shot");
            FindObjectOfType <AudioManager>().Play("Bolt Action");

            // vibration with and without audio clip (clip as a frequency sample)
            VibrationManager.singleton.TriggerVibration(GunShotClip, ovrGrabbable.grabbedBy.GetController());
            //VibrationManager.singleton.TriggerVibration(40, 2, 255, ovrGrabbable.grabbedBy.GetController());

            maxNumberOfBullet--;
            //bulletText.text = maxNumberOfBullet.ToString();
        }
    }