/// <summary> /// Invoked when the value of the adjustable has changed. /// </summary> public virtual void AdjustmentValueChanged(AdjustmentEvent e) { Adjustable adj = e.Adjustable; int value = e.Value; ScrollPanePeer peer = (ScrollPanePeer)Scroller.Peer_Renamed; if (peer != null) { peer.SetValue(adj, value); } Component c = Scroller.GetComponent(0); switch (adj.Orientation) { case Adjustable_Fields.VERTICAL: c.Move(c.Location.x, -(value)); break; case Adjustable_Fields.HORIZONTAL: c.Move(-(value), c.Location.y); break; default: throw new IllegalArgumentException("Illegal adjustable orientation"); } }
private void Start() { _width = _scroller.GetComponent <RectTransform>().rect.width + padding; _height = _scroller.GetComponent <RectTransform>().rect.height + padding; }