T
~toki
I need to write a value over a field of a structure.
.....
public struct ARSubMesh {
private Matrix matrix;
public void setMatrix ( Matrix mat ) {
this.matrix = mat;
}
}
.....
ARSubMesh mesh = getMesh("torus");
mesh.setMatrix ( mat );
.....
public ARSubMesh getMesh(string name) {
// find the mesh *name*
return mesh_found;
}
This don't work because getMesh create a *new* object.
I need some like "return ref mesh_found", but the compiler say "Hey, learn a
bit of c# or ask to the experts..."
Well, here i am, askin to the experts.
How can i write directly over the struct field matrix from a returned value?
.....
public struct ARSubMesh {
private Matrix matrix;
public void setMatrix ( Matrix mat ) {
this.matrix = mat;
}
}
.....
ARSubMesh mesh = getMesh("torus");
mesh.setMatrix ( mat );
.....
public ARSubMesh getMesh(string name) {
// find the mesh *name*
return mesh_found;
}
This don't work because getMesh create a *new* object.
I need some like "return ref mesh_found", but the compiler say "Hey, learn a
bit of c# or ask to the experts..."
Well, here i am, askin to the experts.
How can i write directly over the struct field matrix from a returned value?