Beispiel #1
0
 public IHttpActionResult postScore(PlayerScoreObject gs)
 {
     using (ApplicationDbContext db = new ApplicationDbContext())
     {
         db.GameScores.Add(new GameScore {
             GameID = gs.GameId, PlayerID = gs.PlayerId, score = gs.score
         });
         db.SaveChanges();
         return(Content(HttpStatusCode.OK, gs));
     }
 }
Beispiel #2
0
    void PopulateList()
    {
        if (populated == true)
        {
            return;
        }

        //Create a list at the size of friends.
        for (int i = 0; i < SocialCenter.Instance.FriendSize; i++)
        {
            PlayerScoreObject newObject = NGUITools.AddChild(TopScores.gameObject, PlayerObjectPrefab.gameObject).GetComponent <PlayerScoreObject>();

            //Deactivate and add to the list.
            newObject.gameObject.SetActive(false);

            _PlayersObjects.Add(newObject);
        }


        populated = true;
    }