Made myself a custom npm package of scripts to use across projects, I am hitting an issue with the latest Needle in Unity with WebXR imports. In two identical scripts in the npm package I have import { WebXR } from "@needle-tools/engine/src/engine-components/webxr/WebXR"; which ends up with the generated C# Component using public Needle.Engine.Components.WebXR @xrScript; when it should be public Needle.Engine.WebXR @webXrScript; It only does this for one of the scripts and both have been saved + I have tried reimporting and regenrating the types and components from the npmdef asset in the project view.
The issue is in the asset linked below with LoaderFixer.ts while VRControls.ts does not exhibit the same issue despite the imports being from the same location
Please dont import from the src or lib paths - this might cause issues in bundling. Import from the toplevel import { WebXR } from "@needle-tools/engine instead.
You also have an error in your import using a type that doesnt exist anymore (WebXREvent)
Is it possible that one script was generated before the update and one script was generated after?
Little detour:
The latest version also unifies XR inputs - so you can just implement e.g. onPointerDown on your component and you get down events for XR controllers or hands - similarly you can listen to all events via this.context.input.addEventListener("pointerdown", (args) => { } if you really want to get all inputs (the event args include spatial information now even for screenspace touches or clicks, the args object contains a lot more code comments, let me know if anything is missing or unclear)
@Marcel_Wiessler1 in LoaderFixer.ts I changed the import to from "@needle-tools/engine";
but I still get the generated componenet error: Assets\Needle\epm.modelviewer.codegen\LoaderFixer.cs(19,35): error CS0234: The type or namespace name 'WebXR' does not exist in the namespace 'Needle.Engine.Components' (are you missing an assembly reference?)
What could be causing this?