3DxUnity Package cause Error in Unity on Build: error CS0234: The type or namespace name 'PackageManager' does not exist

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
Whelfen
Posts: 1
Joined: Wed Jan 03, 2024 7:58 am

3DxUnity Package cause Error in Unity on Build: error CS0234: The type or namespace name 'PackageManager' does not exist

Post by Whelfen »

Hi!

I'm creating avatar's in unity for VR-Chat. For the SDK we need to use:
Unity 2022.3.6f1.0.15644

When I build, I get these error, and the compiler stops:

Code: Select all

C:\Program Files\3Dconnexion\3DxWare\3DxUnity3D\src\Runtime\RTTDxController.cs(1322,55): error CS0234: The type or namespace name 'PackageManager' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
and then

Code: Select all

Error building Player because scripts had compiler errors
I can only build my project, when I remove 3DxUnity3D from the package manager. But then, the mouse isn't working for sure.
I give the folder
C:/Program Files/3Dconnexion
a complete acess in Windows (11) with writing permissions for all user and apps, apllied also to subdirectory's.


Also, when I hit "play", I can use the 3D Mouse only in game mode, not in the scene. But the workflow of VR-Chat Avatar creating is to test things in play mode, but in the scene.

Hope someone can help me :), thank you!

Best regards
Whelfen
legofreak
Posts: 1
Joined: Mon Apr 01, 2024 12:14 pm

Re: 3DxUnity Package cause Error in Unity on Build: error CS0234: The type or namespace name 'PackageManager' does not e

Post by legofreak »

I'm getting the same issue. did you ever find a solution?
WeCr8Fun
Posts: 4
Joined: Thu May 09, 2024 4:08 pm

Re: 3DxUnity Package cause Error in Unity on Build: error CS0234: The type or namespace name 'PackageManager' does not e

Post by WeCr8Fun »

Does this have anything with the spacemouse use during AR or VR scenes?
chadfind
Posts: 1
Joined: Thu Sep 12, 2024 9:15 am

Re: 3DxUnity Package cause Error in Unity on Build: error CS0234: The type or namespace name 'PackageManager' does not e

Post by chadfind »

I was able to find a solution while still using the spacemouse package.

In the file RTTDxController.cs there are multiple references to UnityEditor.PackageManager (each will cause the build issue).
These can be commented to only get used in editor mode.

So at line 1323 (just before OnRegisteringPackages which is the first function using UnityEditor.PackageManager) I placed:
#if (UNITY_EDITOR)
Then at line 1370 (after ~RTTDxController which is the last function using it), I placed:
#endif

As mentioned in the original post there is some write permission weirdness with this folder so I copied the file, edited it, then replaced the file with the edited one.

I can now build without having to remove the spacemouse package in the package manager.
I have not seen any issues since.

Not sure why building was never tested by the creators of the file.

Hope this helps,
Chad
Post Reply