- Home /
Question by
smirlianos · Nov 02, 2012 at 12:51 PM ·
c#javascriptjavaconvert
Convert this line of javascript to C# (easy)
How is this in C# ? var object : gameObject;
function Start ()
{
object.active = false;
}
Comment
hey ... Here's some links I found useful in converting between C# and JS :
http://answers.unity3d.com/questions/12911/what-are-the-syntax-differences-in-c-and-javascrip.html
Best Answer
Answer by Yokimato · Nov 02, 2012 at 12:55 PM
public GameObject obj; // can't name this 'object' since that's a c# keyword
void Start() {
obj.active = false;
}
I assume your issue was the keyword ambiguity, but you might want to think twice about using either as a variable name since it doesn't describe which GameObject it is very well.
Your answer
Follow this Question
Related Questions
How do I resize the image on a GUILayout? 1 Answer
convert c# to JavaScript Problem 0 Answers
this script in Javascript?? 0 Answers
Convert c# to Js? 1 Answer
convert java script to c# 1 Answer