Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Assets/Imports/HTC.UnityPlugin/ViveInputUtility/Scripts/ViveRole/ViveRole.cs(31,27): error CS0117: `SteamVR_Utils' does not contain a definition for `Event'
Assets/Imports/HTC.UnityPlugin/ViveInputUtility/Scripts/VivePose/VivePose.cs(49,27): error CS0117: `SteamVR_Utils' does not contain a definition for `Event'
It seems Vive Input Utility is not updated yet. Any fix for this in the meantime?
For code like this:
E.g.:
You can also instead create an "Action" wrapper and enable disable that like so:
For system events like "TrackedDeviceRoleChanged" see SteamVR_ControllerManager.cs as an example: https://github.com/ValveSoftware/steamvr_unity_plugin/blob/master/v5/Assets/SteamVR/Scripts/SteamVR_ControllerManager.cs
Finally, for completely custom events that you want to define yourself, you can take a look at the ChaperoneInfo.Initialized event/action as an example:
https://github.com/ValveSoftware/steamvr_unity_plugin/blob/master/v54/Assets/SteamVR/InteractionSystem/Teleport/Scripts/ChaperoneInfo.cs
The Teleport script also defines a few of its own:
https://github.com/ValveSoftware/steamvr_unity_plugin/blob/master/v54/Assets/SteamVR/InteractionSystem/Teleport/Scripts/Teleport.cs#L113
It also listens for the ChaperoneInfo.Initialized event.
var index = (uint)(int)args[0];
var connected = (bool)args[1];
casting the args. I'm guessing it would just be
OnDeviceConnected (uint index, bool connected)
maybe?
The old code converted it immediately to a uint since it was being passed into GetTrackedDeviceClass which takes a uint instead of an int. In the new code, you can see we moved the cast to where we pass in the value instead.
You're right, it seems to be a orphaned event, dating back to before the official plugin release. I searched our repo and the Valve stuff on Github going back a couple years. I thought I was losing my mind, but your reply reminded me that we'd had to modify the plugin a few times early on to work around some Rift DK2 issues. A few other devs made similar changes, if memory serves. I think a subsequent upgrade of the plugin stomped those changes, but we never noticed because we'd started using Vive devkits by that time.
I also saw this error once on 5.4.3xEditorVR-p3, though after reloading the editor without updating the SteamVR plugin and discarding any changes made, I haven't seen the error since. I'm guessing the error occurs because [InitializeOnLoad] means WWW is called before scene (and editor?) deserialization has completed and the main loop has been entered. It could all be timing. Unity is very unclear on which classes are safe to use outside of the main loop, and complains when you do. Arron, have you tried instantiating WWW inside of static void Update()? Why not if (wwwVersion == null) wwwVersion = new WWW(versionUrl)?
I also encountered the "InitWWW is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead.", and restarting the Unity editor also stopped the occurrence of the error for me as well.
I am using Unity 5.4.0b19 (64-bit), and had upgraded by deleting then re-importing.
Downgraded to this patched 1.1 version
https://github.com/GaryniL/SteamVR-1.1.0-Patch
and got them back. Upgraded again but same thing.
While the migration is a bit painful - I love this change. I complained about the allocations the old approach was causing probably more than a year ago (that was even before I got my Vive ;-) ). So I can only say "at last!!!" ... also, the new way of doing this is actually much easier because you don't need to pass strings which could also have typos in them ... and "where was the documentation of what we can listen for again"? ;-)
I haven't actually tried if everything still works, yet ... just wanted to say: This change, I totally love. Thank you!
I'm also getting this on Unity 5.4.3f3, this is for Windows 64 bit standalone builds, Scripting Backend Mono2x, Api Compatibility Level .NET 2.0. But the only thing that's weird is that you're not seeing this because I believe that's a fairly standard Unity error message when you call stuff from static initializers.
Here's a posting in Unity's blog explaining when and why they have added this: Serialization, Monobehaviour Constructors and Unity 5.4[blogs.unity3d.com]
Unfortunately, that blog posting is actually about another use case and the fixes they suggest won't help with what you're doing.
It took me a little while to find what you're looking for - but it's in the documentation: https://docs.unity3d.com/Manual/RunningEditorCodeOnLaunch.html
... which is what you're apparently already using. Except you have wwwVersion = new WWW(versionUrl); in the constructor instead of only registering the Update there. If you put those two together, the solution becomes kind of obvious.
I've changed this locally to:
Note sure if that's the most elegant way, but it should do.
Actually, it's just a runtime error generated by Unity. You can fairly safely ignore it - the only thing that probably breaks is the SteamVR Unity plugin update check.
Console:
Assets/SteamVR/InteractionSystem/Core/Scripts/Util.cs(538,5): error CS0119: Expression denotes a `variable', where a `method group' was expected
Seems to be a flub in their Util.cs code.
http://imgur.com/a/iJW7I
I just commented out the error line as a temporary fix to get back to work.
Thank you for backing me up with this, I have received absolutely no response in this thread with the same problem. I posted on the first page and was promptly ignored, my bump didn't get a response either. Very annoying when I am completely stalled in my development.
I will attempt this temporary fix, but I would love some sort of response on any action that is being taken on this issue.
Commenting out a line of code does not seem like a very good long-term option to me.