- Home /
javascript to unity javascript conversion
hey, why does this one works on websites but not in Unity? are there any solutions? What i have to write instead? Thanks for reading.
this.makeChildNodes = function (map, heuristic, cutCorners, target) { }
I originally posted that anonymous/lambda functions don't work in Unity, but they apparently do in 3.0. What version of Unity are you using? Are you getting an error? Can you post a bit more of your code to give us some more context?
Answer by Ray-Pendergraph · Sep 14, 2011 at 07:09 PM
The JavaScript that is used in Unity is not the JavaScript that you are used to in a browser at all. It does not use the prototype based creation strategy you are used to nor is it truly dynamically typed. As in C# I think here you can create a function with the correct signature and implementation and just assign the value as the name of the function. Also there is a post about delegates in UnityScript here.
Your answer
Follow this Question
Related Questions
Setting Scroll View Width GUILayout 1 Answer
Progresive sound ? 1 Answer
Animating main player when click on object 2 Answers
Can someone help me fix my Javascript for Flickering Light? 6 Answers