IMPORTANT
we are going to set up SharpKit project because we are going to follow this recommended workflow:
1. install sharpkit
download sharpkit_5_4_9.exe installer from https://github.com/SharpKit/SharpKit/releases (about 10MB).
2. install UnityVS
it's a free tool, google 'visual studio tools for unity' to find download url.
import UnityVS package after installation.
(it's under installing directory, named 'Visual Studio 201x Tools.unitypackage')
3. open unity project in Visual Studio
now there are 2 projects in the solution:
4. add sharpkit project to solution:
r-click on solution -> add -> new project
5. edit SharpKitProj.csproj file, add these lines:
<ItemGroup> <Compile Include="..\Assets\**\*.cs"> <Link>%(RecursiveDir)%(FileName)</Link> </Compile> </ItemGroup>
it adds all .cs files under project Assets folder to SharpKit project (only link, no copy).
5. close solution and reopen it with unity
6. add these dlls to SharpKit project REFERENCES:
UNITY_INSTALL_DIR/Data/Managed/UnityEditor.dll
UNITY_INSTALL_DIR/Data/Managed/UnityEngine.dll
7. add compiling flags to SharpKit project:
UNITY_EDITOR
UNITY_5_1 (when you are running Unity 5.1, add UNITY_4_5 if under Unity4.5, for example)
8. build SharpKit project.
this step will compile all C# classes with JsType attribute to JavaScript file.
-------------------------------------------------------------
back home