- Home /
how can convert this in js?
/*C#*/Vector3 position { get{ return m_Position; } }
/*JS*/var position : Vector3 = ?;
/*C#*/public abstract void Solve(Transform[] bones, Vector3 target);
/*JS*/public abstract function Solve(bones : Transform[], target : Vector3); // ERROR
/*C#*/public abstract int samples {get;}
/*JS*/public abstract var samples : int = ?;
it's from Locomotion System
Comment
Answer by greay · Jun 30, 2012 at 07:34 PM
For #1:
private var m_Position:Vector3;
function get position:Vector3 {
return m_Position;
}
function set position(value:Vector3) {
m_Position = value;
}
For #2 and #3: Unity Javascript doesn't support abstract functions, as far as I know. For the function, leave out abstract & just use an empty implementation. For the second, it's another property so follow the pattern for #1.
Your answer
Follow this Question
Related Questions
Js to C# convert 1 Answer
Converting JS to C# 3 Answers
Lightning Script Js To C# Conversion errors 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers