Hi,
I am Converting codes from javascript to C#.
Javascript code that gone conver is:
public function UpdatePreviewScreen (hashtable : Hashtable)
{
var posIn3D : Vector3;
var ratio : float = 1;
if(hashtable.Contains("Ball"))
{
BallIcon.Hide (false);
posIn3D = hashtable["Ball"];
posIn3D = posIn3D * ratio;
posIn3D.x = posIn3D.x + GroundBG.transform.localPosition.x;
posIn3D.z = posIn3D.z + GroundBG.transform.localPosition.y;
BallIcon.transform.localPosition = new Vector3(posIn3D.x, (posIn3D.z), 0);
}
}
And, I converted to C# Like this:
public void UpdatePreviewScreen (Hashtable hashtable)
{
Vector3 posIn3D;
float ratio = 1;
if(hashtable.Contains("Ball"))
{
BallIcon.Hide (false);
posIn3D = hashtable["Ball"];
posIn3D = posIn3D * ratio;
posIn3D.x = posIn3D.x + GroundBG.transform.localPosition.x;
posIn3D.z = posIn3D.z + GroundBG.transform.localPosition.y;
BallIcon.transform.localPosition = new Vector3(posIn3D.x, (posIn3D.z), 0);
}
}
Compiler shows an error at this line: PosIn3D = hashtable[“Ball”];
how to solve this ???