- Overview:
Adds ability to use PlayFab in Cocos Creator without issues across platforms. Taken from the Playfab JS SDK.
- 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) {
},
});
- Todo
Setup proper typing files and better examples maybe?