Hello community
I have question about Assembly Definition (asmdef).
I making Localization System asset for make localization. I want split it in module CoreTeamGamesSDK.LocalizationSystem.
What i do
I tried to make it, put the Editor scipts in LocalizationSystem/Editor and created in editor folder asmdef for Editor scripts.
I put the Runtime scripts into LocalizationSystem/Scripts and created asmdef for these scripts. In asmdefs i sets the platforms, like in Unity manual for this, set reference to Runtime asmdef in Editor asmdef, but Editor scripts giving me an Error CS0246
What i do wrong
What IDE?
Often I need to close and open Visual Studio for it to see the new assemblies, or any changes to assembly references.
I Use VS code on linux, and assemblies gives me errors in unity
Please show the Inspector views for both your asmdefs.
There could be a mistake with the platforms settings: you would typically disable “Any Platform” then select the platforms you want the assembly to be accessible in including the Editor platform, or enable “Any Platform” and select any platforms you want to exclude not including the Editor platform. You need to keep the Editor platform for the runtime assembly to be used in the editor and be used by the editor assembly.
If you need the assembly to be present in both the Editor and the built player but only when targeting specific platforms (difference from the above is that in the Editor, the assembly will only be there for specific active build targets), you can use “Any Platform” without excluding any platforms, then use define constraints like UNITY_STANDALONE or UNITY_STANDALONE || UNITY_ANDROID
1 Like
On Runtime i only exclude editor and in Editor asmdef i include only editor. that’s what i do from create asmdef’s
Exclude Editor should not be ticked. This will cause the Editor to not be able to use that assembly, and that assembly will not be available in Play Mode in the editor. You need to untick this to allow the Editor and therefore your game in Play Mode and also your Editor-only assembly to use it.
For most normal (non-platform-specific) cases, assemblies used in games at runtime need to have Any Platform ticked with nothing excluded. For platform-specific assemblies, refer to my previous post.
2 Likes
Thanks you very much, i will try this and write