D
Daisy
I came across this problem at work, and now at home... I've got an object
that stores its position in a Vector3 object.
Looks like this:
public class Object3D
{
Vector3 _position;
public Vector3 Position
{
get { return _position; }
}
}
But when I try setting a field, like this:
Object3D dan = new Object3D();
dan.Position.X = 10;
I get the error in the subject, because a Vector3 is a value type.
Given I might just want to increase the X position, is there any way I can
change this value, without setting it to a new Vector3 and passing the other
two fields back in?
that stores its position in a Vector3 object.
Looks like this:
public class Object3D
{
Vector3 _position;
public Vector3 Position
{
get { return _position; }
}
}
But when I try setting a field, like this:
Object3D dan = new Object3D();
dan.Position.X = 10;
I get the error in the subject, because a Vector3 is a value type.
Given I might just want to increase the X position, is there any way I can
change this value, without setting it to a new Vector3 and passing the other
two fields back in?