ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
357 stars 82 forks source link

Please ship with ASMDEF #139

Closed MSFX closed 4 years ago

MSFX commented 5 years ago

Could you please ship a version with asmdef setup, currently with the number of editor directories present it's not really practical creating so many assemblies Thanks

chengnay commented 5 years ago

@MSFX Sorry, we are not very familiar with ASMDEF. Could you explain more on the problem and how to improve this part? How many Plugin SDKs you have imported?

MSFX commented 5 years ago

Thanks for the reply. You can find more info here.

The main issue is with the "Editor" folders you have which should be compiled into a seperate editor assembly so they can't be within directories added under an assembly, so there either needs to be an assembly per Editor directory or you place all Editor scripts into one single Editor directory, which is probably the better approach. My project has 5 plugins and 6 assemblies.

chengnay commented 5 years ago

@MSFX I tried to add ASMDEF to some of the Editor folders, and I will get bunch of compile errors. It is because in VIU, script files will reference to other script files in other directories.

For example, I added ASMDEF under Assets\HTC.UnityPlugin\VRModule\Modules\Editor folder, Compile error, Assets\HTC.UnityPlugin\VRModule\Modules\Editor\GoogleVRModuleEditor.cs(4,72): error CS0234: The type or namespace name 'VRModuleManagerEditor' does not exist in the namespace 'HTC.UnityPlugin.VRModuleManagement' (are you missing an assembly reference?)

Do you have any idea how to approach to resolve this issue?

MSFX commented 5 years ago

So if files within one assembly have to reference scripts within another assembly you have to add that assembly to the list of referenced assemblies shown in the inspector when you select the assembly... hope that makes sense??

MSFX commented 5 years ago

have you managed to resolve this?

chengnay commented 5 years ago

Sorry that VIU might not be able to ship with ASMDEF because VIU supports multi SDKs. It is hard to add dependencies for multi SDKs and it will break if either one doesn't existed in the project. If you do have any idea to resolve this, you could do a pull request.

brunocoimbrar commented 4 years ago

@chengnay in Unity 2019 they added the Version Defines feature in the ASMDEF, which solves the multi SDK dependencies issue. It could be an opt-in feature by having a button to generate the ASMDEFs in the Preferences menu.

I can do that myself and do a pull request, but wanted to first check if this would be an acceptable approach for you, as it will add an extra maintenance layer.

brunocoimbrar commented 4 years ago

Actually Version Defines are not needed as the scripting defines symbols still work with ASMDEF, but due some cross references between VRModule and ViveInputUtility folders it requires assembly definition references to work properly, which is only available on 2019.2.

chengnay commented 4 years ago

@chengnay in Unity 2019 they added the Version Defines feature in the ASMDEF, which solves the multi SDK dependencies issue. It could be an opt-in feature by having a button to generate the ASMDEFs in the Preferences menu.

I can do that myself and do a pull request, but wanted to first check if this would be an acceptable approach for you, as it will add an extra maintenance layer.

You are welcomed to do a pull request. We will review internally again, thanks!

chengnay commented 4 years ago

@MSFX In the latest VIU v1.11.0 already shipped with ASMDEF. This upm version will be updated to Unity Package Manager in the future. ASMDEF is not included in the Unity Asset Store version.