The controller should interact with the UI elements in the canvas as it does in the editor playmode
In the UWP build the the canvas elements are not interacting with the controller. It works fine in the editor.
@bddckr @thestonefox Please let me know if there is any workaround to fix this immediately, I am about to complete a project which has lot of UI interactions. Unfortunately I hadn't tried building the project before. Thanks!
I am having this issue as well. Here is a possible workaround, haven't tried it yet.
@rockwalrus and I were able to resolve this problem. We tracked the issue down to VRTK_UIPointer.OnEnable() > ConfigureEventSystem() > SetEventSystem(cachedEventSystem). If the Event System passed in isn't a VRTK_EventSystem, the component gets added. Within VRTK_EventSystem.OnEnable(), CopyValuesFrom() iterates through all the properties on the current Event System and copies them to the new VRTK_EventSystem. This is where the issue was occurring, specifically in regards to the hideFlags property.
It turns out that Unity automatically performs managed bytecode stripping when you use the IL2CPP scripting backend. Because the property names are not explicitly mentioned in CopyValuesFrom(), the hideFlags property was being erroneously stripped. Following the instructions in the Unity Manual article I just linked, we added a link.xml file to our project as follows:
<linker>
<assembly fullname="UnityEngine.CoreModule">
<type fullname="UnityEngine.Object" preserve="all">
</type>
</assembly>
</linker>
This resolved our problem; UI functions properly in built versions of our application.
@beccannlittle @rockwalrus Thanks for figuring this out!
Unity states one can put the link file in the Assets folder directly or any subdirectory of Assets, so I believe we should be able to ship it with VRTK, though I wonder what happens if you have multiple link files.
Is anyone of you able to check whether multiple link files in a project work?
Thanks again!
@bddckr from that Unity Manual page:
A project can include multiple link.xml files. Each link.xml file can specify a number of different options.
@beccannlittle : Thanks for sharing. It was really helpful. You are a life saver!
Damn I totally didn't see that. I need a vacation 馃槄
Thanks for sharing, will try to get that in soon.
Closing this as it's related to an older version of VRTK (v3.3) the master branch is now on VRTK v4. Feel free to request to reopen if the issue is still present.
Most helpful comment
@rockwalrus and I were able to resolve this problem. We tracked the issue down to
VRTK_UIPointer.OnEnable()>ConfigureEventSystem()>SetEventSystem(cachedEventSystem). If the Event System passed in isn't aVRTK_EventSystem, the component gets added. WithinVRTK_EventSystem.OnEnable(),CopyValuesFrom()iterates through all the properties on the current Event System and copies them to the newVRTK_EventSystem. This is where the issue was occurring, specifically in regards to thehideFlagsproperty.It turns out that Unity automatically performs managed bytecode stripping when you use the IL2CPP scripting backend. Because the property names are not explicitly mentioned in
CopyValuesFrom(), thehideFlagsproperty was being erroneously stripped. Following the instructions in the Unity Manual article I just linked, we added alink.xmlfile to our project as follows:This resolved our problem; UI functions properly in built versions of our application.