To be able to do direct ingestion to Kinesis using the AWS SDK, we need to download the AWS SDK for .NET.
There are two ways to get the required AWS SDKs in order to start developing on AWS in Unity. You can either grab the NuGet packages in Visual Studio, or from the AWS owned GitHub repository of SDKs. The easiest method is to use Visual Studio Community, which is provided with the latest versions of Unity Pro.
Open Visual Studio, select Project and choose
Manage NuGet Packages. If instead you would like to grab our SDKS from GitHub, click here to visit our SDK GitHub repository
Search for the
AWSSDK.CognitoIdentity packages and add them to your project
This workshop also uses the
Newtonsoft.Json package to serialize dictionaries to JSON when sending data to Kinesis Data Streams, so you will need to add this to your project as well. When you download these packages using NuGet, they will download to your packages folder in your Unity project.
API Compatibility Level .NET 4.Xas pictured below. To do this, select
API Compatibility Leveland choose
Plugins folderto support cross-platform compatability with most current game platforms. This will enable your game to support IL2CPP platforms like iOS, Android, Playstation 4, XBox One, and Switch.
You should also create a
link.xml file to minimize dependency issues between NuGet and Unity projects when building and deploying to device. Find out more about link.xml files here. To do this, in your assets folder create a link.xml file with the following code:
This prevents Unity from stripping required data from the libraries when building. Some platforms, like iOS, even require a link.xml file to work on the device. The System.Linq line helps with IL2CPP platforms, like iOS, to avoid incompatibilities with NewtonSoft, the library we will be using to serialize dictionaries to JSON. Click here for more information about link.xml files, .NET 4.x, and .NET Standard 2.0 requirements.
For more detailed information on integrating AWS and Unity using the SDKs, check out this blog post - “Generate custom game events from Unity integrated with the Game Analytics Pipeline”