Project is in uJS and using Photon PUN.
So I’m trying to use a hashtable for setting some custom properties in the Photon player custom properties :
function ResetScores()
{
var props : Hashtable = new Hashtable();
props.Add( "Kills", 0 );
props.Add( "Deaths", 0 );
props.Add( "Assists", 0 );
PhotonNetwork.player.SetCustomProperties( props );
}
Now the only reference to uJS hashtables is here but there is no example of adding keys and values. I check a MSDN example and a few Photon questions and they are all in C#, but declared the same.
well that gave the error :
Assets/_Scripts/GameManager.js(386,57): BCE0017: The best overload for the method 'PhotonPlayer.SetCustomProperties(ExitGames.Client.Photon.Hashtable)' is not compatible with the argument list '(System.Collections.Hashtable)'.
I’m using generic List in the same script :
import System.Collections.Generic;
public class GameManager extends Photon.MonoBehaviour {
so thinking I had to use the photons system of collection, I tried using :
var props : ExitGames.Client.Photon.Hashtable = new Hashtable();
which gave the error :
Assets/_Scripts/GameManager.js(380,69): BCE0022: Cannot convert 'System.Collections.Hashtable' to 'ExitGames.Client.Photon.Hashtable'.
This is the first time I’ve used hashtable, all out of ideas and could really do with some advice and/or help. Maybe the problem is using System.Collections or Photon.MonoBehaviour ?
Thanks for reading.