• Stars
    star
    349
  • Rank 121,528 (Top 3 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created over 10 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unity C# SDKs for PlayFab

UnitySDK README

The PlayFab Unity SDK consists of two packages—PlayFab UnitySDK and the optional PlayFab Unity Editor Extensions.

The Editor Extensions package provides a simple user interface to help you download, install, configure, upgrade the PlayFab SDK. It is the simpler way to get set up right away. However, it requires you to include additional files into your project.

If you are an advanced user, consider installing the PlayFab SDK directly by extracting the package and configuring the scriptable-objects using the Unity inspector window. Detailed instructions on how to get started are provided in the section below.

1. Overview:

This document describes the process of configuring and building the PlayFab Unity package and distribution package. The document also contains instructions for developers to start using the package in their Unity games.

2. Prerequisites:

This document assumes familiarity with the Unity game engine, MonoDevelop Unity .NET programming environment, and Mac OS X operating system environment.

To connect to the PlayFab service, your machine must be running TLS v1.2 or better.

3. Installing or Upgrading the PlayFab UnitySdk

Editor Extensions UI Installation

  1. Download the Editor Extensions package
  2. Open and run your Unity project
  3. From the Unity editor, go to Assets > Import Package > Custom Package and then select the downloaded PlayFabEditorExtensions package. For latest instructions on how to add a custom package, go to Unity documentation site.
  4. A new window pops up displaying all the files that would be imported into your project. Select Import to add all of the files. After a successful installation, you will see the PlayFab panel with the Create account or login UI in the Unity editor.

Editor Extensions SDK Installation/Update

  1. Log in using the Editor Extensions panel
  2. If your SDK is missing or out-of-date, you'll see an orange install/update button

Manual Installation

You can install the SDK directly by downloading the latest SDK Asset Package directly.

Detailed Manual Instructions:

  • Download UnitySDK.unitypackage to a safe location.
  • [Only When updating]: Delete your {ProjectLocation}/assets/PlayFab*/ directories.
  • (Very old SDKs) You may also need to delete PlayFab specific files in your {ProjectLocation}/assets/Plugins/ directory.
  • Failing to do this step may cause compiler errors and/or unexpected runtime errors
  • Unpack the .unitypackage file into your project.

Advanced users can copy the contents of https://github.com/PlayFab/UnitySDK/tree/master/ExampleTestProject/Assets into their existing project.

PlayFab Configuration:

You must configure the SDK with your unique TitleId. This is done via the PlayFabSharedSettings ScriptableObject or the PlayFab Editor Extensions panel.

In your Unity Project tab, navigate to: assets/PlayFabSDK/Shared/Public/Resources and select the PlayFabSharedSettings ScriptableObject.

Advanced users can still add this line of code anywhere in their game setup:

PlayFabSettings.TitleId = "144";

HTTP Request Configuration:

From the EdEx panel (Settings -> Project), or the PlayFabSharedSettings scriptable object, you can define one of two options for making your HTTPS Rest calls to PlayFab.

The UnityWww option uses the Unity WWW class to make web requests. This is the more stable option, but all requests are made using the main Unity thread.

The HttpWebRequest option uses the C# native HttpRequest library. This option is multi-threaded, and most of the request will not execute on the main thread. Additionally, advanced users can use PlayFabSettings to customize their request timeouts and other HttpRequest settings (not documented). There is currently a bug in this option where performance will degrade for long running GameServers, or clients that run for more than 24 hours. For these situations, please use UnityWWW.

To make server API calls:

The best way to do this is enable it from the PlayFab Editor Extensions Panel (PlayFab Panel -> Settings -> API).

Non EdEx panel users: This guide will direct you how to find the "Scripting Define Symbols": https://docs.unity3d.com/Manual/PlatformDependentCompilation.html, under the heading "Platform Custom Defines".

The Unity setting you need to modify is: Edit -> Projet Settings -> Player -> "PC & Mac & Linux Standalone" -> "Platform Custom Defines" Add ENABLE_PLAYFABSERVER_API

You can also choose other platforms in place of "PC & Mac & Linux Standalone", but this is not recommended.

You can now set "Developer Secret Key" in assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset

Refer to Secret key Management to find your secret key, also called a developer key to your PlayFab Title.

Advanced users can still set their secret key anywhere in their game setup:

    PlayFabSettings.DeveloperSecretKey = "Find this in your dashboard/settings https://developer.playfab.com/title/properties/{your title Id}"; //your Developer Secret goes here.

4. Usage Instructions:

You are now ready to begin making API calls using the PlayFabClientAPI class. Check out the online documentation for a complete list of available APIs.

New Users:
  • Check out our Tutorials, Samples and more here

5. Troubleshooting:

CASE: Follow these instructions to disable IDFA for your IOS release:

  • Do a global code search in the C# project for: #define DISABLE_IDFA
  • Uncomment any of these defines you find.
  • Alternately, you can add DISABLE_IDFA to the "Scripting Define Symbols" in the Build settings,
  • Or, Check the same API Settings option in our Editor Extension plugin

CASE: If you run into conflicts when upgrading SDKs, remove all files from previous versions and perform a fresh import of our unitypackage or SDK files.

Contact Us

We love to hear from our developer community! Do you have ideas on how we can make our products and services better?

Our Developer Success Team can assist with answering any questions as well as process any feedback you have about PlayFab services.

Forums, Support and Knowledge Base

6. Copyright and Licensing Information:

Apache License -- Version 2.0, January 2004 http://www.apache.org/licenses/

Full details available within the LICENSE file.

More Repositories

1

consuldotnet

.NET API for Consul (http://www.consul.io/)
C#
693
star
2

thundernetes

Thundernetes makes it easy to run your game servers on Kubernetes
Go
311
star
3

PlayFab-Samples

This repository contains Sample code, Recipes and Video Tutorials demonstrating how to integrate various PlayFab features
C#
203
star
4

MpsSamples

Samples that show how to use PlayFab's Gameserver SDK for Multiplayer Servers
C#
149
star
5

gsdk

Game Server SDK for PlayFab Multiplayer Servers
C++
145
star
6

UnrealMarketplacePlugin

Source code for the PlayFab Marketplace Plugin for Unreal
C++
125
star
7

UnicornBattle

A complete example title showing a complete PlayFab integration with complex game systems.
C#
120
star
8

PlayFabGameServer

Out of the Box Game Server for PlayFab.com
C#
99
star
9

CSharpSDK

SDK for C#/.net environments other than Unity
C#
71
star
10

PlayFab

This repo is the official home of PlayFab on GitHub. Subscribe to it to be notified of announcements and service releases.
71
star
11

SDKGenerator

SDK Generator, produces the source code for all PlayFab SDKs.
C#
69
star
12

MpsAgent

Azure PlayFab Multiplayer Servers LocalMultiplayerAgent project and helper libraries
C#
48
star
13

PostmanCollection

PlayFab Postman Collection
45
star
14

JavaScriptSDK

JavaScriptSDK for the Client API of PlayFab
JavaScript
45
star
15

vanguard-outrider

A demo game for populating Azure PlayFab titles
TypeScript
41
star
16

PlayFabPartyUnity

39
star
17

LuaSdk

PlayFab Lua SDK for LuaDist command-line, Defold, and more
Lua
39
star
18

PlayFabMultiplayerUnreal

PlayFab Online Subsystem Plugin for Unreal Engine
C++
39
star
19

API_Specs

JSON files describing PlayFab's HTTP APIs
JavaScript
36
star
20

NodeSDK

Playfab SDK for node.js applications
JavaScript
34
star
21

XPlatCppSdk

Cross Platform C++ SDK
C++
33
star
22

CloudScriptSamples

Sample scripts demonstrating custom game logic for hosting in PlayFab.
JavaScript
29
star
23

SdkTestingCloudScript

This is the Cloud Script used for the internal testing of all SDKs.
TypeScript
26
star
24

vscode-playfab-explorer

PlayFab Explorer extension for VS Code
TypeScript
23
star
25

UnityEditorExtensions

The home for PlayFab's Unity Editor plugin. This plugin houses a custom inspector for viewing and configuring the PlayFab SDK.
C#
23
star
26

LocalMultiplayerAgent

An executable that mimics PlayFab Multiplayer (Thunderhead) operations to aid in local debugging.
22
star
27

JavaSDK

PlayFab SDK for Java applications
Java
20
star
28

PlayFabParty

The libraries, headers, and documentation for accessing the PlayFab Party feature.
C++
20
star
29

mpscommunity

Community content for Azure PlayFab Multiplayer Servers
18
star
30

ActionScriptSDK

ActionScript3 SDK for use in Adobe Flash and AIR.
ActionScript
16
star
31

PlayFabCLI

Tool for using PlayFab via CLI
C#
16
star
32

MultiplayerServerSecureWebsocket

Reverse proxy sample project to enable web socket connections over https to PlayFab hosted game servers.
C#
13
star
33

pf-af-devfuncs

Azure Functions related to the PlayFab developer experience
C#
11
star
34

PlayFabAssetBundleManager

Modification To AssetBundleManager for use with PlayFab
C#
11
star
35

PythonSdk

PlayFab Python Sdk
Python
9
star
36

Cocos2d-xSDK

PlayFab SDKs for c++ based Cocos2d-x game development
C++
7
star
37

Objective_C_SDK

OSX / iOS native SDK
Objective-C
7
star
38

MpsPowershell

Powershell client for the PlayFab Multiplayer Servers API.
PowerShell
7
star
39

PhpSdk

PHP Sdk for PlayFab https://api.playfab.com/sdks/php
PHP
7
star
40

PlayFabMultiplayerUnity

PlayFab Multiplayer Unity SDK
7
star
41

PlayFabUnityRumble

A sample multiplayer game intended to demonstrate the use of PlayFab Party and Multiplayer Unity SDKs in games.
C#
4
star
42

MultiplayerPowershell

Powershell cmdlets for Multiplayer service
C#
4
star
43

VmStartupScriptGallery

Repository containing samples and starter templates for the VmStartupScript feature of Azure PlayFab Multiplayer Servers
PowerShell
4
star
44

PlayFabCSdk

C++
3
star
45

PlayFabPowerBITemplates

This repository contains Power BI templates to quickly access key game KPIs.
3
star
46

thundernetescontrib

Helpful utilities for Thundernetes
Go
3
star
47

XPlatCoreTemplate

The template files for the XPlat build, and core template files for private builds
C++
3
star
48

thundernetes-ui

Thundernetes UI is a frontend for Thundernetes that allows you to visualize and interact with your game server clusters
TypeScript
3
star
49

UeDemo

A Breakout game with the UE PlayFab Plugin integrated and utilized
C++
2
star
50

PlayFabMultiplayer

PlayFab Multiplayer C++ SDK
PowerShell
2
star
51

PlayFabNetRumble

A sample multiplayer game intended to demonstrate the use of PlayFab Party and Multiplayer C++ SDKs in games.
C++
2
star
52

.github

1
star