Hi, all.
I’m going to construct a test environment in Unity.
My build tree is as follows:
-- App
| |
| |-- App.asmdef
| |-- AppController.cs
|
| -- Standard Assets
| |
| |-- StandardAssets.asmdef
| ...
| | -- Effects / ImageEffects/Scripts
| |
| | -- ImageEffects.cs
|
|-- Test
|
|-- Test.cs
Note
This tree contains App.asmdef as test target.
App.asmdef contains StandardAssets.asmdef in Assembly Definition References list.
Question
In this tree, AppController.cs cannot refer to a class in ImageEffects.cs.
What should I do to make AppController.cs to refer ImageEffects.cs?
App.asmdef contains StandardAssets.asmdef in Assembly Definition References list but StandardAssets.asmdef does not seem to work.
I think it is because Standard Assets directory is a special one for Unity.
I would not like to change directory name(Standard Assets) to avoid this problem.
Any nice idea to solve this problem?
1 Like
And what’s your reason for this decision? The Standard Assets folder by its own will compile it’s script into the first pass assembly by default. This is an ancient mechanic of Unity long before assembly definition files existed. When you specifically create assembly definition files, you should not cross / mix different systems.
Assembly definition files are essentially a neat in-place solution to create and complile standalone assemblies. Before we had them we could have created a separate DLL project outside of Unity, compiles all those external assemblies ourselfs and then import them into Unity as a DLL. Some people and studios have done this in the past. With assembly definition files we don’t need separate projects since Unity will compile and relate the assemblies automatically for you.
2 Likes
I have a hunch that OP is just not aware of the special purpose of a folder named “Standard Assets”.
I would advice renaming the folder to “Shared Assets” or “Common Assets” or something.
Even if Unity didn’t treat “Standard Assets” differently, these assets are just not “standard”. Strictly speaking “standard” is not the right word to refer to commonly used / reusable assets. 
1 Like
Thanks a lot!
So, I will rename the Standard Assets folder to pass the test scenario, and then I will refactor my code to remove the Standard Assets.