/// <summary> /// /// </summary> /// <param name="p"></param> /// <param name="kills"></param> public static void PostKill(this PhotonPlayer p, int kills) { int current = p.GetKills(); current = current + kills; Hashtable score = new Hashtable(); // using PUN's implementation of Hashtable score[PropertiesKeys.KillsKey] = current; p.SetCustomProperties(score); // this locally sets the score and will sync it in-game asap. }
public static void AddKills(this PhotonPlayer player, int killsToAddToCurrent) { int current = player.GetKills(); current = current + killsToAddToCurrent; Hashtable kills = new Hashtable(); // using PUN's implementation of Hashtable kills[PunPlayerScores.PlayerKillProp] = current; player.SetCustomProperties(kills); // this locally sets the score and will sync it in-game asap. }