- Home /
Unexpected values at the inspector when initializing member values from built-in arrays
Hello guys,
I'm having some problem at the inspector using the Javascript built-in array when initializing the class member values.
Let's get the following type class:
class myType
{
var shouldBeOne : int = 1;
};
The bellow code is ok, the 'shouldBeOne' member at the myVar is filled with 1 as expected:
class myBehaviourClass extends MonoBehaviour
{
var myVar : myType;
};
But the next code is not ok... the 'shouldBeOne' member at the myVar elements will be filled with 0...
class myBehaviourClass extends MonoBehaviour
{
var myVar : myType[];
};
This problem occurs only at the Editor. If I put a "myVar = new myType[1];" at the Start() the values will be filled ok.
What can I do to have the right behaviour at the inspector?
Thanks,
Gilberto
Your answer
Follow this Question
Related Questions
Arrays and the inspector 1 Answer
Custom Inspector & Arrays 0 Answers
Filling a large public array in editor 1 Answer
Array of abstract class in inspector 2 Answers
'time' not a member of 'Object' 1 Answer