SGB/Unity Tutorials

Make Exported SGB Projects Compatible with Unity 2019

Author: Mad Stuntman
¶ Taken directly from the SGB Discord (with my own notes).

The easiest way to convert your SGB exported project for Unity 5.6 to Unity 2019 is 2-step conversion. Honestly you CAN convert the project directly from 5.6 to 2019, BUT you need to do a lot of operations which require your attention as well as decent knowledge of Unity internals. So I publish the solution for a wide range of users, especially for users who are using Unity only for make multi-platform builds.

You can now download all versions on the Unity Hub. Download the version most appropriate for your project and then use the Hub to download version.
  1. Download and install Unity 2018.2.21f1. ¶ Wulf’s Note: This version is relevant.
  2. Download and install Unity 2019.2.0a13 (or latest).
  3. Download and install Microsoft .NET Framework 4.7.1 Developer Pack. Even if you have Microsoft .NET Framework 4.7.2 installed you MUST install .NET 4.7.1 because of you need to install the targeting pack for a specific version of .NET Framework.
  4. Open SGB exported project in Unity 2018.2.21f1 and just save the project.
  5. Open saved project in Unity 2019.2.0a13. If you got a message about your project require Microsoft .NET Framework 4.7.1 it means something went wrong on step 3 and you need reinstall Microsoft .NET Framework 4.7.1 Developer Pack.
  6. After you opened your project you’ll get a lot of errors in Unity console (shortcut Ctrl+Shift+C) like Assets\src\engine\MapScene\MapData.cs(15,26): error CS0104: ‘Tuple<,>’ is an ambiguous reference between ‘Eppy.Tuple<T1, T2>’ and ‘System.Tuple<T1, T2>’ is an ambiguous reference between ‘Eppy.Tuple<T1, T2>‘ and ‘System.Tuple<T1, T2>‘. C# scripts affected by this errors are:
    \Assets\src\common\Util\BinaryReaderWrapper.cs
    \Assets\src\engine\GameMain.cs
    \Assets\src\engine\MapScene\MapData.cs
    \Assets\src\common\GameData\System.cs
    All that you need to fix errors is to find all occurrences of Tuple and change it to Eppy.Tuple.
    Just for info… The newest versions of Unity are based on the newest versions of Mono with C# 7.0 support where System.Tuple type was introduced. It led to the ambiguous references between Eppy.Tuple<T1, T2> as type of Eppy class used by developers and System.Tuple<T1, T2> standart type.