- Home /
How to reference class from Runtime asmdef in Editor asmdef from within a local unity package?
For the life of me, I can't figure this out. I have a local unity package with this folder structure:
Runtime/
HelixGenerator.cs
Lumic.Music.asmdef
Editor/
HelixGeneratorEditor.cs
Lumic.Music.Editor.asmdef (this one only has "Editor" checked in target platform)
Now, this code fails to compile because it can't find the type (classname is correct, correct namespace imported).
[CustomEditor(typeof(HelixGenerator), true)]
public class HelixGeneratorEditor : Editor
When I inspect the project references in Visual Studio, I don't see "Lumic.Music" being referenced in "Lumic.Music.Editor". I don't find any option anywhere to be able to add that reference.
Am I missing something?
Answer by CodesCove · Jan 13, 2021 at 04:33 AM
Add assembly references via Inspector. Just select the asmdef file and add the referenced assembly to the Assembly Definition References list.
Thanks, that works now (with the 2019 LTS version). I wonder if it was a regression in one of the 2020 versions I was using - earlier I was getting a dropdown in the assembly reference property drawer of the editor's asmdef, and it would only show pre-built DLLs but not the runtime asmdef. Also, $$anonymous$$d posting your comment as an answer?
Your answer
Follow this Question
Related Questions
How to fix error : Unable to update following assemblies:Assets/Plugins/Example.dll 1 Answer
No Git Executable Was Found 2 Answers
Unity Engine script assemblies not accessible in my package 1 Answer
"Unity" prefix in custom package asmdef name 2 Answers
Unity/C# Added assembelies, MonoDevelop builds, Unity won't run 0 Answers