Hi Gokhan,
Please find below code snippet and let me know if you need any help from my side:
String scoreId = "<Enter_score_id>";
double gameScore = 3500;
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
Dictionary<string, object> jsonDoc = new Dictionary<string, object> ();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
App42API.SetDbName(dbName);
scoreBoardService.AddJSONObject(collectionName, jsonDoc);
App42API.Initialize("API_KEY","SECRET_KEY");
ScoreBoardService scoreBoardService = App42API.BuildScoreBoardService();
scoreBoardService.EditScoreValueById(scoreId, gameScore, new UnityCallBack());
public class UnityCallBack : App42CallBack
{
public void OnSuccess(object response)
{
Game game = (Game) response;
App42Log.Console("gameName is " + game.GetName());
for(int i = 0;i<game.GetScoreList().Count;i++)
{
App42Log.Console("userName is : " + game.GetScoreList()[i].GetUserName());
App42Log.Console("score is : " + game.GetScoreList()[i].GetValue());
App42Log.Console("scoreId is : " + game.GetScoreList()[i].GetScoreId());
App42Log.Console("owner is "+ game.GetScoreList()[i].GetJsonDocList()[0].GetOwner());
App42Log.Console("Doc id is "+ game.GetScoreList()[i].GetJsonDocList()[0].GetDocId());
App42Log.Console("updated at "+ game.GetScoreList()[i].GetJsonDocList()[0].GetUpdatedAt());
App42Log.Console("created at "+ game.GetScoreList()[i].GetJsonDocList()[0].GetCreatedAt());
App42Log.Console("json doc is : "+ game.GetScoreList()[i].GetJsonDocList()[0].GetJsonDoc());
}
}
public void OnException(Exception e)
{
App42Log.Console("Exception : " + e);
}
}
Regards,
Himanshu Sharma