Game Tech Tutorial
Published in

Game Tech Tutorial

Tips to Choose Azure PlayFab Unity SDK or C# SDK for Unity Games

This post will explore the difference between PlayFab Unity SDK and C# SDK, as well as provide guidelines to integrate.

  • How to choose a suitable SDK for your Unity games?

Table of contents

  • Unity SDK VS C# SDK
  • How to integrate Unity SDK?
  • How to integrate C# SDK?

Unity SDK VS C# SDK

Unity SDK

  • Uses Callback pattern to return a value
  • Can support Unity v5.3+
  • Requires to handle the logic in a resultCallback and an errorCallback.
  • Can support .NET 2.0 or higher

C# SDK

  • Uses Task-based Asynchronous Pattern (TAP): async/await
  • Required to support C# v5 or above
  • Only can support .NET 4.5 or higher
  • Easy to maintain that you can control all the logic in the same place by async/await

Analysis

If you have a new game project, it's better to choose C# SDK for PlayFab because Task-based Asynchronous patterns will make your codes clean and easy to maintain.

Example:

Let’s demonstrate both SDKs to invoke the same function - LoginWithAndroidDeviceID.

Unity SDK

  • This makes your codes hard to debug and trace errors when your code project becomes bigger.

C# SDK

How to integrate Unity SDK?

  • Download the PlayFab Unity SDK package here.
  • Import it into your project
  • Setup Title ID and Developer Secret Key in PlayFabSDK/Shared/Public/Resource/PlayFabSharedSettings.asset

How to integrate C# SDK?

  • Pass apiSettings to clientApi.

Summary

You have learned the difference between PlayFab Unity SDK and C# SDK in this post.

  • Task-based Asynchronous pattern

--

--

High-quality technical tutorials: AWS, GCP, Azure, Unity, SDK, Security, DevOps, and more.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eric Wei

Senior Full Stack Engineer & Solution architecture | AWS, GCP, Azure | Cloud, Unity Game Development, SDK, DevOps, and more.