campfireunion / VRKeys

A drum-style keyboard for VR in Unity
https://assetstore.unity.com/packages/tools/input-management/vrkeys-99222
MIT License
98 stars 14 forks source link

Unity Asset does not work for Unity 2017 #20

Open TheSeanLavery opened 5 years ago

TheSeanLavery commented 5 years ago

I think the update to 2019 broke something.

lux commented 5 years ago

The update relies on newer Unity APIs that were introduced in 2018, so projects will either have to stick with the previous version or upgrade Unity I'm afraid.

OptrixAU commented 5 years ago

We can't put in some conditional compile directives? I'm using the LTS version of 2018.4, and I can't use the package either. I LOVE the updates to XR devices in 2019, but I was hoping you could use conditional compile directives to maintain compatibility with the 2018.4 version, since we are unable to upgrade our major project at this time.

lux commented 5 years ago

My mistake on updating to the 2019 XR devices APIs, I didn't realize they changed so much between 2018 and 2019 but it looks like the tracking capabilities require 2019...

Does it work if you stick with the previous release? The only real change was the 2019 updates.

TheSeanLavery commented 5 years ago

2019 seems so new and untested. There are a lot of performance and UI bugs that might ruin project.

I'm staying away from 2019 until it can be proven more stable than 2017 and 2018 in a production environment.

It would be nice if the asset in the store had a 2017 version that worked.

OptrixAU commented 5 years ago

The performance of the Light-Weight Render Pipeline on VR in 2019 is very nice, and controller input is SO much better with the 2019 API. LWRP also appears to work around a BUNCH of problems you get on the Quest headset, like with post-processing effects and single-pass rendering on Android.

lux commented 5 years ago

I'll see about putting together a 2018 branch soon. I understand we can't all jump to the latest version right away.

OptrixAU commented 5 years ago

The major issues seem to be mostly about controller input - you might be able to use preprocessor directives to have a single branch that supports both.

For example, in Assets/VRKeys/Scripts/Controller.cs, you could substitute functions like the ones below...

private bool DeviceIsValid () {
#if UNITY_2019_0_OR_NEWER
      return GetDevice ().isValid;
#else
      return GetDevice().IsValid;
#endif
}

and

public bool OnGrip () {
            if (!DeviceIsValid ()) return false;
                        bool value;
#if UNITY_2019_0_OR_NEWER                       
                        GetDevice ().TryGetFeatureValue (CommonUsages.gripButton, out value);
#else
                         value = Input.GetButtonDown("grip");
#endif
                         return value;
        }

Note that this would mean you would need to define "Grip" as a button in your input manager.