Hello,
as I understand, it is possible simulate behavior of struct, by using this construct:
private class StructName extends System.ValueType
I would like to use a struct in my case, but what I came across is that I can’t change value of the struct, with this kind of a code:
public var structure : StructName;
private function UpdateValues (tmpStruct : StructName) {
tmpStruct.floatValue = 10.0;
}
public function Start () {
UpdateValues (structure);
}
while this does work
public var structure : StructName;
private function UpdateValues () {
structure.floatValue = 10.0;
}
public function Start () {
UpdateValues ();
}
Why is that so?