Exemple #1
0
    public static void AddDeaths(this PhotonPlayer player, int deathsToAddToCurrent)
    {
        int current = player.GetDeaths();

        current = current + deathsToAddToCurrent;
        player.SetProperty(PhotonPlayerExtensions.deathsProp, current);
    }
Exemple #2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="p"></param>
    /// <param name="deaths"></param>
    public static void PostDeaths(this PhotonPlayer p, int deaths)
    {
        int current = p.GetDeaths();

        current = current + deaths;

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

        score[PropertiesKeys.DeathsKey] = current;

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