Coder Social home page Coder Social logo

unitysdk's Introduction

UnitySDK README

Welcome to the PlayFab Unity SDK. The quickest way to get started is to import our asset package: PlayFabClientSDK.unitypackage.

  1. Overview:

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

  1. 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.

  1. Upgrading from previous versions

The easist way to stay up-to-date is to install our latest asset package. This will ensure that only new and changed files will be updated.

You can also manually update by overwriting the entire PlayFabSDK folder as well as the relevant Plugins subdirectories.

  1. Source Code & Key Repository Components:

Our repository contians these major sections:

  1. PlayFabClientSDK.unitypackage - The fastest way to get started, ready for importing into your Unity project

  2. PlayFabClientSample - The base Unity project from which the asset package is built

    1. This is the minimal subset of files required to use the PlayFab Client API
  3. PlayFabServerSample - Similar to PlayFabClientSample, but using server APIs

    1. This is the minimal subset of files required to use the PlayFab Server API
    2. This project contains a variable called DeveloperSecretKey - For security reasons you must never expose this value to players
  4. PlayFabCombinedTestingSample - This sample has a working set of unit tests that make several API calls and verify PlayFab functionality

    1. This project demonstrates how to execute both client and server API calls with the SDK, and minimally analyze the results
    2. This project contains a variable called DeveloperSecretKey - For security reasons you should never expose this value to players
  5. UnityAndroidPluginSource - Contains the source code for our native Android plugin

  6. Installing and Configuring the PlayFab Unity SDK:


Install the Unity SDK using the Unity Package

Open your Unity project, open the PlayFabClientSDK.unitypackage, and import the entire structure.

Install the Unity SDK into another Unity project:

  1. Extract the UnitySdk to a location of your choice (described as the UnitySDkFolder for the rest of this example)
  2. Create a new Unity project or open an existing Unity project
  3. Navigate to UnitySDkFolder\PlayFabClientSample\Assets
  4. Copy the PlayFabSDK folder from the example project, into your new/existing project's Assets folder
  5. Begin integrating PlayFab calls into your project
  6. UnitySDkFolder\PlayFabCombinedTestingSample\Assets\PlayFabSDK\Internal\Testing\PlayFabApiTest.cs - This file executes some basic API calls, which you can use as an example.

To building your game client, install our native iOS and Android plugins. To do this, drag the Plugins folder to the root(Assets/Plugins) of the Unity project.

With projects running on Unity3d < 5.0, use the standard folder structure (Assets/Plugins/iOS & Assets/Plugins/Android). This means that if you are already using plugins, you must merge the PlayFab files into your existing folder structure.

Configuration:

You must configure the SDK with you unique TitleId. This is done via the PlayFabSetting object. Set your Title id at the startup either in an Awake method.

To configure the SDK in code, add the following code to your game's startup code:

	using PlayFab;

	void Awake(){
		PlayFabSettings.TitleId = "AD08"; //your title id goes here.
	} 

Use AD08 as a demonstration TitleId if you would like to try the various pre-made scenes without creating and configurating your own title.

To make server API calls, set your DeveloperSecretKey, which can be found in the Settings > Credentials section of the PlayFab dashboard (PlayFab website) - Again, for security reasons, you must never publish this value to your players.

	using PlayFab;

	void Awake(){
		PlayFabSettings.DeveloperSecretKey = "Find this in your dashboard/settings https://developer.playfab.com/title/properties/{your title Id}"; //your Developer Secret goes here.
		// For security reasons you must never expose this value to players
	} 
  1. 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
  1. Troubleshooting:

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

  • In Unity, navigate to and open: PlayFabClientSample/Assets/Plugins/iOS/PlayFabURLRequest.mm
  • Uncomment the first line: // #define DISABLE_IDFA // If you need to disable IDFA for your game, uncomment this
  • In Unity, navigate to and open: PlayFabClientSample/Assets/Plugins/iOS/PlayFabiOS.cs
  • Uncomment the first line: // #define DISABLE_IDFA // If you need to disable IDFA for your game, uncomment this
  • In Unity, view the inspector window when you select (do not open): PlayFabClientSample/Assets/Plugins/iOS/PlayFabURLRequest.mm
  • Uncheck the "AdSupport" option under "Platform settings"

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.

CASE: When creating web player builds, ensure that you have the proper WWW Security Emulation

  • The configuration variable can be found under Edit > Project Settings > Editor more
  • Your address will be https://xxxx.playfablogic.com, where xxxx is your title ID
  • A good overview of the issue can be found here

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

  1. Copyright and Licensing Information:

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

Full details available within the LICENSE file.

unitysdk's People

Contributors

hungwunfai avatar jeremy-playfab avatar marcowilliamspf avatar markval avatar matt-augustine avatar ruth-playfab avatar snoopdougdoug avatar zac-playfab avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.