Exemplo n.º 1
0
 void TopKills()
 {
     max = PhotonNetwork.LocalPlayer;
     foreach (var item in PhotonNetwork.PlayerList)
     {
         if (item.GetKills() > max.GetKills())
         {
             max = item;
         }
     }
     ingameui.TopFragger.text = "Killleader " + max.NickName + " with " + max.GetKills() + " kill(s)";
     if (max.GetKills() == KillsToWin || max.GetKills() > KillsToWin)
     {
         EventManager.TriggerEvent("GameEnd");
     }
 }
    public static void AddKill(this Photon.Realtime.Player player, int killToAddToCurrent)
    {
        int current = player.GetKills();

        current = current + killToAddToCurrent;

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

        kills[PunPlayerKillsDeaths.PlayerKillProp] = current;

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