1
因此,我一直在努力將排行榜實施到我的移動應用程序幾乎整天,並且除了顯示朋友的個人資料圖片外,到他們的分數。如何在Unity C中顯示Facebook朋友個人資料圖片#
在V6.x中,你可以使用FB.GetPictureUrl但現在我認爲會有某種FB.API實現,它允許我做同樣的事情?
無論如何,這裏就是我正在做的事情
private void ScoresCallBack(IGraphResult result)
{
int num = -1;
var dataList = result.ResultDictionary ["data"] as List<object>;
foreach (Transform child in leaderboardPanel.transform)
{
GameObject.Destroy (child.gameObject);
}
foreach (object player in dataList)
{
num++;
var dataDict = dataList [num] as Dictionary<string, object>;
long score = (long)dataDict ["score"];
var user = dataDict ["user"] as Dictionary<string, object>;
string userName = user ["name"] as string;
string userID = user ["id"] as string;
GameObject ScorePanel;
ScorePanel = Instantiate (scoreEntryPanel) as GameObject;
ScorePanel.transform.SetParent (leaderboardPanel.transform, false);
ScorePanel.SetActive (true);
ScorePanel.transform.GetChild(1).GetComponent<Text>().text = userName;
ScorePanel.transform.GetChild (2).GetComponent<Text>().text = score.ToString();
}
}
哦,API調用我正在爲
FB.API(「/應用程序/分?場=得分, user.limit(30)「,HttpMethod.GET,ScoresCallBack);
所以,謝謝!有任何想法嗎?