Need some help referencing a Hashtable I created in the awake function:
So in the Awake function I am trying to set up the custom properties:
public void Awake(){
ExitGames.Client.Photon.Hashtable props = new ExitGames.Client.Photon.Hashtable();
props.Add("score", 0);
PhotonNetwork.player.SetCustomProperties(props);
}
Later, in a function where the player has gotten a point added to his score, I have:
[code]
public void getPoint(){
score = (int)PhotonNetwork.player.CustomProperties["score"];
score++;
PhotonNetwork.player.CustomProperties ["score"] = score;
PhotonNetwork.player.SetCustomProperties(props);
}
[/code]
I get the following error: The name `props' does not exist in the current context
Anyone know how I can reference the props Hashtable?
So in the Awake function I am trying to set up the custom properties:
public void Awake(){
ExitGames.Client.Photon.Hashtable props = new ExitGames.Client.Photon.Hashtable();
props.Add("score", 0);
PhotonNetwork.player.SetCustomProperties(props);
}
Later, in a function where the player has gotten a point added to his score, I have:
[code]
public void getPoint(){
score = (int)PhotonNetwork.player.CustomProperties["score"];
score++;
PhotonNetwork.player.CustomProperties ["score"] = score;
PhotonNetwork.player.SetCustomProperties(props);
}
[/code]
I get the following error: The name `props' does not exist in the current context
Anyone know how I can reference the props Hashtable?