Skip to content

Playfab

yenmoc edited this page Dec 23, 2022 · 2 revisions

LEADERBOARD

  • install package playfab
  • install package ios login (optional if you build for ios platform)
  • config setting via menu item Tool/Pancake/Playfab image
  • in tab [API Features] enable Allow client to post player statistics
  • in tab [Client Profile Options]
    • in Allow client access to profile properties enable Display Name, Locations, Statistics
    • in Allow client access to sensitive profile properties enable Linked accounts
client profile options in playfab title setting
  • install sample leaderboard via PackageManager. You also need to install the package ui effect to run correctly
  • in sample leaderboard has already config file, select GameServiceSettings in folder Resources to active setting
  • use Update Aggregation menu in menu context of PopupLeaderboard to create table leaderboard for 240 countries just do this once

Screenshot_2

  • replace the code in #if region replace your code with your own code to manage popups the way you want
  • for update score to leaderboard when first time you enter name completed. Example you can find in class ButtonLeaderBoard using valueExpression
GetComponent<ButtonLeaderboard>().valueExpression += () => UnityEngine.Random.Range(1, 100);
  • when you want update score of user in leaderboard you can you method UpdatePlayerStatistics
int newScore = 100;
AuthService.UpdatePlayerStatistics("name_table", newScore); 
Clone this wiki locally