External MonoBehaviours within single assembly (unity 2017

I’ve got an assembly that contains two mono behaviours, however, it would appear that unity doesn’t support more than one per assembly? When I try and attach the behaviour to a game object unity complains it can’t find the script object?

However, if i rename the assembly to the name of one of the scripts it works.

Regards,
Ron.

This is the only way that I build MonoBehaviours and, I assure you, you can have more than one.

Do you expand the assembly and drag the individual MonoBehaviour definitions out of it onto your GameObject?

Maybe post a .zip with a few of the behavior definitions in it or your .csproj or something?

Yep I see the individual scripts when the assembly is expanded, but once i drag’n’drop unity complains. I’ll put together a simple example

Thanks,
Ron.

This is my unity test project the assembly simply has two empty mono behaviours B1 & B2. If you attempt to drag the script to the cube you’ll get an error. The project is using .net 4.6

Regards,
Ron.

3259581–251280–New Unity Project 1.zip (1.72 MB)

When I open up that .dll in the object browser, I don’t even see B2. I also can’t browse dependencies.

Something weird is going on, here.

Are you using Visual Studio 2017 to build this? If so, can you check to make sure it’s set to the right build target (one of the Unity build targets).

Hmm appears that the problem was … Select Platforms for plugins had Exclude Platforms Editor selected. Not sure why it would give such a vague error. I will go through the steps again to ensure that this is in fact the root cause of the original error. Thanks for your help.