public static void AddDeaths(this PhotonPlayer player, int deathsToAddToCurrent) { int current = player.GetDeaths(); current = current + deathsToAddToCurrent; player.SetProperty(PhotonPlayerExtensions.deathsProp, current); }
/// <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. }