Exemple #1
0
    public static void AddMainScore(this PhotonPlayer player, int mainScoreToAdd)
    {
        int current = player.GetMainScore();

        current = current + mainScoreToAdd;

        Hashtable mainScore = new Hashtable();  // using PUN's implementation of Hashtable

        mainScore[PunPlayerScores.PlayerMainScoreProp] = current;

        player.SetCustomProperties(mainScore);  // this locally sets the score and will sync it in-game asap.
    }