下列 C# 程式碼範例使用 PlayFab 伺服器 API 建立 (如果索引鍵值已存在則更新) 索引鍵值組,其中索引鍵 Class 的值為 Fighter,Race 的值為 Human。
public void UpdateUserInternalData() { PlayFabServerAPI.UpdateUserInternalData(new UpdateUserInternalDataRequest() { PlayFabId = "user PlayFabId here - obtained from any successful LoginResult", Data = new Dictionary<string, string>() { {"Class", "Fighter"}, {"Race", "Human"}, }, }, result => Debug.Log("Set internal user data successful"), error => { Debug.Log("Got error updating internal user data:"); Debug.Log(error.GenerateErrorReport()); });}