To compile the source code into the ORKFramework.dll used by your Unity project, you need to set up the references in MonoDevelop.

ORK Framework 2.34.1 and higher

ORK Framework version 2.34.1 and higher contains a new source code project containing the complete C# source code for compiling the 3 ORK DLL files.

It’s a Visual Studio 2017 project solution containing 3 individual projects:

  • Core
    Handles core ORK functionality (non-gameplay), e.g. data serialization.
    Compiles the ORKFrameworkCore.dll file.
  • Editor
    Handles the editor.
    Compiles the ORKFrameworkEditor.dll file.
  • Framework
    Handles all of ORK’s gameplay functionality.
    Compiles the ORKFramework.dll file.

The projects are already set up ready to use, including needed Unity DLL files. You don’t need to set up any references.

Compiling for different Unity versions

Compiling for different Unity versions is done by switching the project’s solution configuration.

  • Unity_5_6
    For Unity 5.6 versions.
  • Unity_2017
    For Unity 2017 versions.
  • Unity_2018
    For Unity 2018 and newer versions.
    I.e. also for Unity 2019, 2020 or 2021.

After switching the solution configuration, it’s recommended to also clean the solution before compilation. E.g. in Visual Studio 2017 this is done via the menu: Build > Clean Solution

When the compilation has been successfull, you can find the DLL files in bin/X/ in the solution’s folder (X being the Unity version you compiled for).

Copy the ORKFramework.dll and ORKFrameworkCore.dll files into your Unity project to Assets/ORK Framework/DLL/ and replace the already existing files.

Copy the ORKFrameworkEditor.dll file into your Unity project to Assets/ORK Framework/DLL/Editor/ and replace the already existing file.

ORK Framework 2.34.0 and lower

ORK Framework version 2.34.0 and lower only contain the gameplay source code. Follow these instructions to set up the code project.

To compile the source code into the ORKFramework.dll used by your Unity project, you need to set up the references in MonoDevelop.

The references are set up in the Solution View of MonoDevelop.

howto_project_references1

In the Framework project of the ORK Framework Gameplay solution, either double click References or right click and select Edit References. This will open the reference editor.

howto_project_references2

You need to add three references:

  • UnityEngine.dll
    Can be found in your Unity installation folder.
    Windows: Editor/Data/Managed/UnityEngine.dll
    Mac OSX: Unity.app/Contents/Frameworks/UnityEngine.dll
  • UnityEngine.UI.dll
    Can be found in your Unity installation folder.
    Windows: Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll
    Mac OSX: Unity.app/Contents/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll
  • ORKFrameworkCore.dll
    Comes with the ORK Framework package.
    After import, it can be found in your Unity project in Assets/ORK Framework/DLL/.

Since this is most likely the first time you’re adding them, you need to select the .Net Assembly tab and locate the DLL files in the file browser. Add them by either double clicking or selecting them and clicking on the Add button. Once you’ve added all three DLLs, you can confirm the changes by clicking on OK. Please note that you also need to have the System reference in the project, this should already be added by default.

Your solution view should now look like this:

howto_project_references3

You’re now able to compile the project.

When the compilation has been successfull, you can find the ORKFramework.dll in bin/Release/ in the solution’s folder.

Copy the ORKFramework.dll into your Unity project to Assets/ORK Framework/DLL/ and replace the already existing one.

Compiling for different Unity versions

When compiling for one of the supported Unity versions, make sure to use the correct DLL files from that version and the correct build configuration:

  • Unity 5.6
    Use the Unity_5_6 build configuration.
  • Unity 2017
    Use the Unity_2017 build configuration.
  • Unity 2018 (and newer)
    Use the Unity_2018 build configuration.

In MonoDevelop, the build configuration can be changed in the upper left of the menu.

Tip: Automatic distribution

You can use Custom Commands in MonoDevelop to automatically place the newly compiled DLL in your project.

This can be done using batch files that’ll copy the DLL for you – the batch file can be executed as a custom command after building the DLL. You can add custom commands in the Project Options of the Framework project. You can open the options by double clicking on the project (or by double clicking and selecting Options).

Tip: Using Visual Studio

When using Visual Studio, make sure to use the Visual Studio Tools for Unity extension (should come with Unity).

To set up the correct target framework, open the properties of the Framework project (right-click on Framework and select Properties in the context menu). In the Application section of the properties, selec the Unity 3.5 .net Subset Base Class Libraries as the Target Framework.