Page 1 of 1

convert c# to Javascript(bump all of you-Closed)

Posted: Sun Nov 09, 2014 6:06 pm
by nite4000
I have a few lines of code here that I need help with converting from c# to JavaScript

any help would be great

Code: Select all

GameObject.Find("GameManager").GetComponent<GameManager>().tokenCount++;
tokenCount is a variable in the gamemanager script which is JS but this is c# code I need to make this JS

this line here is c# as well in the GameManager c# file but when I try to make it JS it don't work

Code: Select all

int gameTime = (int)startTime;
as well as this line is from gamemanager as well which I need to make it JS

Code: Select all

			Rect winScreenRect = new Rect(Screen.width/2 - (Screen.width *.5f/2),Screen.height/2 - (Screen.height *.5f/2),Screen.width *.5f,Screen.height *.5f);

help would be great with this

Re: convert c# to Javascript

Posted: Sun Nov 09, 2014 6:24 pm
by requinix
You've given WAY too little information for us to have even the slightest clue what to do.

What's GameObject? What does .Find() do? What does GetComponent<>() do? What's the tokenCount? Where are all those things located in Javascript?
What is gameTime? Where is it used? Where did startTime come from? Are either of those defined in the Javascript? Where and when?
Screen information. Does that correlate to Javascript's window.screen? How are you going to translate a Rect into Javascript? Where is that used?

Re: convert c# to Javascript

Posted: Sun Nov 09, 2014 6:34 pm
by nite4000
then you don't know anything about about c# or JS so then you are a waste of time as is this forum. will not be back

Re: convert c# to Javascript(bump all of you-Closed)

Posted: Sun Nov 09, 2014 7:27 pm
by requinix
I'm employed as a web developer and I specialize in PHP and C#.

Best of luck finding a C# developer who knows everything about your application without you having to tell them anything about it.