playfabcocoscreator

1.0.5 • Public • Published

PlayFab Cocos Creator Extension

  1. Overview:

Adds ability to use PlayFab in Cocos Creator without issues across platforms. Taken from the Playfab JS SDK.

  1. Example Usage

var PlayFab = require('playfabcocoscreator')
cc.Class({
    extends: cc.Component,

    properties: {
        label: {
            default: null,
            type: cc.Label
        },
        // defaults, set visually when attaching this script to the Canvas
        text: 'Hello, World!'
    },

    // use this for initialization
    onLoad: function () {
        //this.label.string = this.text;
        
        console.log(PlayFab);
        PlayFab.settings.titleId = "<titleId>";
        PlayFab.ClientApi.LoginWithCustomID(
            {
                CustomID:"<CustomID>"
            }, (res, err)=>{
                if(err){
                    console.log("Error", err);
                    return;
                }
                console.log("result:" , res);
            }

        );
        
        
        
    },

    // called every frame
    update: function (dt) {

    },
});
  1. Todo

Setup proper typing files and better examples maybe?

/playfabcocoscreator/

    Package Sidebar

    Install

    npm i playfabcocoscreator

    Weekly Downloads

    1

    Version

    1.0.5

    License

    ISC

    Last publish

    Collaborators

    • dwiper