BioMotionLab / TUX

A framework for experiments in Unity and VR
https://biomotionlab.github.io/TUX/
Other
29 stars 4 forks source link

Editor Namespace in PackageInstallDetector Overrides Editor class from Unity #38

Closed DerMilchmann closed 2 years ago

DerMilchmann commented 2 years ago

Hey,

I played around with the HDRP and imported an Empty Template from Unity. This template derives its Readme Scripts from the Unity Editor class. This causes compile errors when used together with your Framework, because PackageInstallDetector.cs declares a namespace Editor.

It's not too big of an Issue, since its just template code that can be deleted. But maybe this could cause trouble for anyone trying to write their own Editor Code.

kn1cht commented 2 years ago

I encountered the same problem. The Editor namespace interferers with scripts using the Editor class (in my project, Oculus Plugin causes many errors).

https://github.com/BioMotionLab/TUX/blob/e0951febd4bcaf50c5a8f370c78561582e7094a9/BML_TUX_Project/Packages/bmlTUX/Editor/PackageInstallDetector.cs#L10-L15

Possible workaround is to rename namespace to the name except "Editor".

@@ -8,7 +8,7 @@ using UnityEditor;
 using UnityEditor.PackageManager;
 using UnityEngine;

-namespace Editor {
+namespace bmlTUX.Editor {
     public class PackageInstallDetector : AssetPostprocessor {

         const string PackageName = "com.biomotionlab.tux";
AdamBebko commented 2 years ago

Thanks, I'll try to implement this in the next version. My apologies, I've just started a new job and haven't had time to publish the new version, but it's coming along slowly :). Feel free to submit pull requests if you'd like it sooner (to the dev branch)

AdamBebko commented 2 years ago

fixed in upcoming v3