- Home /
Conversion help - c# to javacript
Hey guys.
I'm following a tutorial (Tut, help needed at 8:10), and I can't work out how to convert a single line:
PlayerNode GetPlayerNode (NetworkPlayer netPlay)
{
}
Into UnityScript/Javascript. The rest I am fine with (so far) but I would really appreciate if someone could help me.
Thanks!
Answer by Piflik · Dec 29, 2012 at 08:11 PM
function GetPlayerNode : PlayerNode (netPlay : NetworkPlayer) {
}
Methinks...
Edit: Or not...thinking about it...
Edit2: Long time since I did anything in Javascript, but I think you don't need a return type for js-functions...just write the function without return type and return whatever you want...
function GetPlayerNode (netPlay : NetworkPlayer) {
}
Edit3: Oh, right, type after the parameters...thanks Mike
function GetPlayerNode (netPlay : NetworkPlayer) : PlayerNode {
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Passing parameters dynamically with Unity Event 0 Answers
Best way to handle Sockets? 0 Answers
Photon Network Problems 1 Answer