I have a 2022.3 project using the AR Mobile template that has the basic setup I need with the starter assets provided. In the XR Interaction Toolkit folder there are Starter Asset folders with Assembly Definitions. I think that’s why the XR scripts and mine can’t reference each other.
I made an assembly definition reference in my script folder and pointed it at the XR definition and that works, but I then can’t access the plugins folder from my scripts.
In the end I just need to check a variable and call a function from a unity XR script and ideally would like any script to talk to another.
I know its not advised to add to or modify another script like this or deleting all the assembly definitions, but Ill take any solution as long as it works, whether its something to do with assembly definitions or not.
Thanks!
I think if you have ANY asmdef references then you need to add them all manually, such as the one to the plugins… I haven’t fiddled with them in a while so I forget the details but I remember them being all-or-nothing in some subtle fashion.
For plugins that are managed plugins (precompiled DLLs), for automatic inclusion, you need to make sure those are marked as “Auto Reference” in their inspector. That way, assembly definition assemblies will automatically reference them. If they aren’t marked as Auto Reference and you’d rather not change that, you can add precompiled assembly references to an individual assembly definition manually.
1 Like
Thanks for the replies!
I found a solution that lets me work around the issue.
I discovered I could add ‘using UnityEngine.XR.Interaction.Toolkit.Samples.StarterAssets’ to the top of my script to access the XR script where I set up a delegate. I can add the function calls needed to the delegate from my script, then call the delegate from inside the XR script.
Hopefully this helps someone else.