public class TouchableArea {
public Rect rect;
public Rect Rect{
get{return rect;}
set{rect = value;}
}
}
Above is my class. Rect
is a struct and has a function Set
to set new value. When I use the property to set a new value to rect nothing happens, but when I use the rect directly everything is fine.
TouchableArea t = new TouchableArea();
t.Rect.Set(newValue);//Through property, nothing happens
t.rect.Set(newValue);//Directly access, it works.
Does this mean it's illegal to call a function through a property?