In that video, he write a script that uses get component, but how would I write that in C#? IO’ve tried re-writing it, got no lcuk
At least post what you want us to convert for you.......
1.) There are a ton of examples of using C# GetComponent. Did you try [searching][1]? 2.) Please review and [mark][2] answers to some of your [previous][3] questions. 3.) There's no Java in that video. It's Javascript. Completely different. [1]: http://answers.unity3d.com/questions/31958/i-cant-understand-the-syntax-of-getcomponent-in-c.html [2]: http://answers.unity3d.com/questions/582706/mesh-question.html [3]: http://answers.unity3d.com/questions/582626/is-there-like-a-setcomponent-1.html
.... var mylight :light = gameObject.find("Light")gameobject.getcomponent("Light"); mylight.enabled = false;
[http://docs.unity3d.com/Documentation/ScriptReference/GameObject.GetComponent.html][1] Use the Unity Scripting Reference, at the above-left, there is a drop-down box Scripting Reference using.... Select Javascript, then select C# to see the same example in each language. Also be vary wary of where to use capitols : Light GameObject Find gameObject GetComponent [1]: http://docs.unity3d.com/Documentation/ScriptReference/GameObject.GetComponent.html
it sayd no reference available.
At least post what you want us to convert for you.......
– vexe1.) There are a ton of examples of using C# GetComponent. Did you try [searching][1]? 2.) Please review and [mark][2] answers to some of your [previous][3] questions. 3.) There's no Java in that video. It's Javascript. Completely different. [1]: http://answers.unity3d.com/questions/31958/i-cant-understand-the-syntax-of-getcomponent-in-c.html [2]: http://answers.unity3d.com/questions/582706/mesh-question.html [3]: http://answers.unity3d.com/questions/582626/is-there-like-a-setcomponent-1.html
– tanoshimi.... var mylight :light = gameObject.find("Light")gameobject.getcomponent("Light"); mylight.enabled = false;
– applejuices[http://docs.unity3d.com/Documentation/ScriptReference/GameObject.GetComponent.html][1] Use the Unity Scripting Reference, at the above-left, there is a drop-down box Scripting Reference using.... Select Javascript, then select C# to see the same example in each language. Also be vary wary of where to use capitols : Light GameObject Find gameObject GetComponent [1]: http://docs.unity3d.com/Documentation/ScriptReference/GameObject.GetComponent.html
– AlucardJayit sayd no reference available.
– applejuices