Jump to content
 
s.evgeniy

Controller Input events are not work

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

Share this post


Link to post
Share on other sites

Still getting started with the SDK myself and I was stuck on something similar. Not sure if this is the correct approach but do check if you have this prefab in the scene and list all of the buttons you expect input from.

buttons.PNG

 

@Cotta @Tony PH Lin

Share this post


Link to post
Share on other sites

Please sign in to comment

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

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...