how to count customPlayerProps in PlayerList

Options
hi All,
i hv trouble, and get confused,

i dont know how to count customplayerProps Value of each photonPlayer in PlayerList.

the case :
1. CustomProperties named "Dead" as Int.
2. if player dead, so 'Dead Props' add 1.
3. all players in PlayerList have a team label(red and blue).
4. red team 2 players, blue team 2 players
5. how to count all dead of each team?

so finally i can get data like :
Blue Dead VS Red Dead


my sample as incorrect :
	void Update ()
	{
		foreach (PhotonPlayer p in PhotonNetwork.playerList)
		{
			if(p.GetTeam() == PunTeams.Team.blue)
			{
				killA = killA + p.Dead();
			}
			else
			{
				killB = killB + p.Dead();
			}
		}
	}

Comments

  • trying this but failed
    void OnPhotonPlayerPropertiesChanged (object[] obj)
    	{
    		Hashtable props = obj[1] as Hashtable;
    		if(props.ContainsKey(PunPlayer.PlayerKilledProp))
    		{
    			foreach (PhotonPlayer p in PhotonNetwork.playerList)
    			{
    				if(p.GetTeam() == PunTeams.Team.blue)
    				{
    					killA += 1;
    				}
    				else
    				{
    					killB += 1;
    				}
    			}
    		}
    	}
    
  • for a while, im create an room Props as a solution.