What is Unity?

Unity is a cross-platform game development engine from Unity Technologies. It enables you to create rich, interactive 3D experiences by providing ways to assemble your art and assets into scenes and environments, add physics, and simultaneously play-test and edit games. When you're finished building and testing, the Unity engine creates a binary for your chosen platform, such as an Android APK that you can publish on Amazon Appstore.

Where can I get Unity?

Download Unity from the Unity website. The base version is free, which makes it easy to give it and the Amazon plug-ins a spin and get your next game to market in record time.

Step 1. Import the GameCircle Unity Package

When you import the GameCircle Unity package, Unity will override existing files in your project with those in the package. Before importing the GameCircle Unity package, review the list of included files and compare this list with your current project to check for overlap. If a file exists in both your project and the package, verify that any changes you have made locally are backed up somewhere outside of your project. After you import the GameCircle package, use your favorite file merging software to compare and merge the differences between the file in the package and the file you had backed up locally.

Step 2. Add the GameCircleManager to Your Scene

GameCircleManager is a Unity GameObject with an attached script that sets it to be persistent between level loads. GameCircle requires this object to be in your scene so that the libraries for GameCircle can communicate with Unity. GameCircleManager receives messages from the GameCircle SDK and forwards them to the appropriate GameCircle Plugin functions.

In Unity, click Assets, click Plugins, and then select GameCircleAndroid/prefabs/.

Add the GameCircleManager game object to your scene.

Step 3. Check if the Amazon GameCircle Service is Ready

This code checks IsServiceReady before accessing Gamecircle features and functionality. This will return False on unsupported platforms.

bool isServiceReady = AGSClient.IsServiceReady();

Step 4. Initialize GameCircle

In one of your initialization scripts for your game, initialize GameCircle:

...AGSClient.ServiceReadyEvent+=serviceReadyHandler;AGSClient.ServiceNotReadyEvent+=serviceNotReadyHandler;boolusesLeaderboards=true;boolusesAchievements=true;boolusesWhispersync=true;AGSClient.Init(usesLeaderboards,usesAchievements,usesWhispersync);...privatevoidserviceNotReadyHandler(stringerror){Debug.Log("Service is not ready");}privatevoidserviceReadyHandler(){Debug.Log("Service is ready");}

Note: Your customers see a list of GameCircle features in the welcome message when your game starts and on the sign-in page for the game. To avoid confusion, in _AGSClient.Init_, initialize only the features that you actually support.

Step 7. Set the minimum API level for your build

In Unity, click File > Build Settings.

Ensure that Android is the current platform, and click the Player Settings button. Player Settings is displayed in the Inspector.
(If Android isn't the current platform, select it in the list and click the Switch Platforms button.)

In Player Settings, expand the Other Settings section.

Under Identification, set the field Minimum API Level to the following: "Android 2.3.3 "Gingerbread" (API level10)".

Integrating GameCircle Features in Your Game

The following sections demonstrate how to implement Whispersync for Games, leaderboards, and achievements in your game.

The GameCircle Unity plugin is provided with sample logic to help guide you in implementing GameCircle features. These samples are in the folder Assets/Plugins/AmazonGameCirclePlugin/Example. Run the included AmazonGameCircleExample.unity scene to try out GameCircle features.

Implement Whispersync for Games

High Value Example

After initializing Amazon GameCircle in your Unity game, you can set a high number in Whispersync for Games.