Placeholder-Software / Dissonance

Unity Voice Chat Asset
71 stars 5 forks source link

[bug] Can't move Plugins folder into Dissonance folder #163

Closed BananaHemic closed 5 years ago

BananaHemic commented 5 years ago

Context

I like to organize all assets from the unity store into a top-level folder named "3rd-Party". I tried to move Dissonance folder into the 3rd-Party folder, and then the Plugins folder into the Dissonance folder. This causes a lot of ambiguous method call errors.

Expected Behavior

I should be able to move folders around as I see fit.

Actual Behavior

I get errors when moving Dissonance folders

Your Environment

Dissonance v6.4.1 Unity 2018.4.3f1 Using Dark Rift integration

martindevans commented 5 years ago

Hi BananaHemic,

Unity doesn't let you move a binary plugin (e.g. opus.dll or AudioPluginDissonance.dll) once the editor has been opened. If you close the editor, move the folder and then re-open the editor it should work.

If that doesn't work could you send me the log you get when the errors occur, thanks.

BananaHemic commented 5 years ago

Still happens when moving the folder with Unity closed.

Relevant bit of the logs: Dissonance has been detected at: 'Assets/3rd-Party/Dissonance/Plugins/Dissonance' UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogWarning(Object) Dissonance.Editor.Windows.Startup:CheckInstallLocation() (at Assets\Plugins\Dissonance\Editor\Windows\Startup.cs:85) Dissonance.Editor.Windows.Startup:Update() (at Assets\Plugins\Dissonance\Editor\Windows\Startup.cs:40) UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\Editor\Mono\EditorApplication.cs:200)

(Filename: Assets/Plugins/Dissonance/Editor/Windows/Startup.cs Line: 85)

DissonanceRootPath.BasePath will be adjusted from 'Assets/Plugins/Dissonance' to 'Assets/3rd-Party/Dissonance/Plugins/Dissonance' UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogWarning(Object) Dissonance.Editor.Windows.Startup:CheckInstallLocation() (at Assets\Plugins\Dissonance\Editor\Windows\Startup.cs:86) Dissonance.Editor.Windows.Startup:Update() (at Assets\Plugins\Dissonance\Editor\Windows\Startup.cs:40) UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\Editor\Mono\EditorApplication.cs:200)

(Filename: Assets/Plugins/Dissonance/Editor/Windows/Startup.cs Line: 86)

DissonanceRootPath.BasePath has been adjusted, forcing a project recompile UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogWarning(Object) Dissonance.Editor.Windows.Startup:CheckInstallLocation() (at Assets\Plugins\Dissonance\Editor\Windows\Startup.cs:98) Dissonance.Editor.Windows.Startup:Update() (at Assets\Plugins\Dissonance\Editor\Windows\Startup.cs:40) UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\Editor\Mono\EditorApplication.cs:200)

And then a lot of errors messages about existing definitions, such as: Assets\3rd-Party\Dissonance\Plugins\Dissonance\Core\Jetbrains.cs(51,27): error CS0101: The namespace 'Dissonance' already contains a definition for 'CanBeNullAttribute'

I've never seen a Unity asset manage it's own directory like yours does, what's the purpose of BasePath?

martindevans commented 5 years ago

Aha I think I've spotted the problem, I think the the BasePath thing is a red herring.

The Assets/Dissonance folder and the Assets/Plugins/Dissonance folder are compiled by Unity into different assemblies (things in Assets/Plugins are handled differently), this means that the same thing can be defined in both of as long as one of the definitions is internal to the assembly (the other thing, in the other assembly, cannot see it so it doesn't cause any issues). It sounds like you've moved Dissonance out of the Assets/Plugins folder, which now means it's being compiled by unity into the same assembly as the main Assets/Dissonance folder, causing a conflict.

You can resolve this in a couple of ways:

I've never seen a Unity asset manage it's own directory like yours does, what's the purpose of BasePath?

Our editor extensions (e.g. the welcome window, the inspectors etc) need to load some assets (e.g. icons). We could put these into a Resources folder and load them by name but then they will be compiled into your game as useless assets. To prevent that from happening we load them directly by their exact file path. Because of this we need to know where Dissonance is located so we can work out the exact file path for assets.

BananaHemic commented 5 years ago

Makes sense, thanks!

martindevans commented 5 years ago

Glad I could help :)