Monday, December 9, 2013

Sharing C# Source Code With A Unity3D Project

I ran into some issues recently trying to share some common networking and data classes between a client application, a middleware ASP.NET server, and a configuration/server management tool.  All three of them needed to be able to serialize/de-serialize the same XML data; however, Unity3D does not currently support (natively) the ability to reference source code files outside of its project directory structure.

The easy solution to this on Windows is to create a symbolic link, and it works nicely.

I'll be revisiting this problem when I go to build on OSX (I presume that I'll be messing with my samba conf) and there are ways you can trick your source control system into accomplishing this (but it's really hacky) - so this isn't a panacea for the issue.

Hopefully the Unity team will introduce its own linking system that handles this (if Mono doesn't already have it...)

Worst case I'll be writing some file synchronization scripts that trigger the Unity editor to copy from the common direct (which is problematic if I make changes in Unity - but hopefully I can avoid that.)

Sigh...

No comments:

Post a Comment