Excluding scripts based on build

I'm designing a client/server system where the client simply inherits from the server for the core engine. As such, I'd liek to be able to have the server and the client in the same Unity project (specifying a specific level for the server, and the rest for the client).

However, I'm running into a problem with the server's MySQL support. Namely that I don't want to include the DLLs in the player (webplayer). Is there an easy way to exclude the DLLs and the database related server code from the player builds? Or should I just give up and make two separate projects?

In the case of two projects, would there be an easy way to have a shared common engine section that both projects access? The only way I see it working is if the files exist in both Asset folders.... do shortcuts work?

Any thoughts on this subject would be much appreciated.

For anyone who still looking for answers to this question…

The best solution is to use assembly definitions. One for the client and one for server. Then inside the assembly definition you can use the Define Constraints which will let you use a #define constraint such as UNITY_SERVER or !UNITY _SERVER. If the constraint is true the assembly will be compiled and included into the build.

Simply add !UNITY_SERVER to the Game.Client assembly and UNITY_SERVER to the Game.Server assembly.

Create three different projects would probably be best.

The first project would be your unity project. (the client) The second project would be the server The third project would be the core which has all the functionality that the server and the client shares. This could be a DLL in your Assets/Plugins folder.