Hello,
I don’t get a problem with #pragma strict and the code below. I have an Array filled with all my "tradeNode"s; the components, not the GameObjects containing them. I’d like to call a function (Tick()) in every one of them. But if I do this:
var node : tradeNode;
for (node in nodes) {
node.Tick();
}
However, this fails: “BCE0019: ‘Tick’ is not a member of ‘Object’.”
I fixed it like this:
var node : tradeNode;
for (node in nodes) {
var tmpNode : tradeNode = node as tradeNode;
tmpNode.Tick();
}
But that seems wrong somehow. As far as I see it, the “for (node in nodes)” doesn’t actually returns my component (“tradeNode”), but an “Object” - even though I’ve got the variable declared as the former. What am I missing here?