Jump to content
Happy Holidays! Limited Staff Responses: 1/20 - 1/31 ×

Controller Input events are not work


s.evgeniy
 Share

Recommended Posts

Hello.Im using unity 2018.3.14f1 and wave vr sdk 3.1.1
After create empty scene , import sdk  , add to scene necessary prefab WaveVR I create script and add to new game object.This script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using wvr;
using WVR_Log;
public class MyWaveVRInputManager : MonoBehaviour
{
    string LOG_TAG = "MyWaveVRInputManager";
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {       
        foreach (var dev in WaveVR_Controller.DeviceTypes)
        {
            if(WaveVR_Controller.Input(dev).GetPressDown(WaveVR_ButtonList.EButtons.Trigger))
            {
                Log.i(LOG_TAG,"GetPressDown " +dev+":"+ WaveVR_ButtonList.EButtons.Trigger);
            }
            if (WaveVR_Controller.Input(dev).GetPressUp(WaveVR_ButtonList.EButtons.Trigger))
            {
                Log.i(LOG_TAG, "GetPressUp " + dev + ":" + WaveVR_ButtonList.EButtons.Trigger);
            }
            if (WaveVR_Controller.Input(dev).GetPress(WaveVR_ButtonList.EButtons.Trigger))
            {
                Log.i(LOG_TAG, "GetPress " + dev + ":" + WaveVR_ButtonList.EButtons.Trigger);
            }


            if (WaveVR_Controller.Input(dev).GetPressDown(WaveVR_ButtonList.EButtons.Touchpad))
            {
                Log.i(LOG_TAG, "GetPressDown " + dev + ":" + WaveVR_ButtonList.EButtons.Touchpad);
            }
            if (WaveVR_Controller.Input(dev).GetPressUp(WaveVR_ButtonList.EButtons.Touchpad))
            {
                Log.i(LOG_TAG, "GetPressUp " + dev + ":" + WaveVR_ButtonList.EButtons.Touchpad);
            }
            if (WaveVR_Controller.Input(dev).GetPress(WaveVR_ButtonList.EButtons.Touchpad))
            {
                Log.i(LOG_TAG, "GetPress " + dev + ":" + WaveVR_ButtonList.EButtons.Touchpad);
            }




            if (WaveVR_Controller.Input(dev).GetTouchDown(WaveVR_ButtonList.EButtons.Touchpad))
            {
                Log.i(LOG_TAG, "GetTouchDown " + dev + ":" + WaveVR_ButtonList.EButtons.Touchpad);
            }
            if (WaveVR_Controller.Input(dev).GetTouchUp(WaveVR_ButtonList.EButtons.Touchpad))
            {
                Log.i(LOG_TAG, "GetTouchUp " + dev + ":" + WaveVR_ButtonList.EButtons.Touchpad);
            }
            if (WaveVR_Controller.Input(dev).GetTouch(WaveVR_ButtonList.EButtons.Touchpad))
            {
                Log.i(LOG_TAG, "GetTouch " + dev + ":" + WaveVR_ButtonList.EButtons.Touchpad);
            }
        }
    }
}

I can't get anyone event from controller!
After research problem I see that events are not arrived from WVR_Android.PollEventQueue.It is place link Unity and native environment.Controller is connected,logcat of Android Studio logging all touches and presses.but Unity no
sorry for my english.help to decide problem please

 

@Cotta @Tony PH Lin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...