void DrawViewRect(ScrollViewDrawer contentsDrawer) { GUI.BeginGroup(viewRect); contentsRect.y -= viewRect.y; contentsRect.y -= position.y; GUI.BeginGroup(contentsRect); contentsDrawer(viewRect, position); GUI.EndGroup(); GUI.EndGroup(); }
public void Draw(Rect viewRect, Rect contentsRect, ScrollViewDrawer contentsDrawer) { this.viewRect = viewRect; this.contentsRect = contentsRect; HandleScrollWheel(); DrawVerticalScrollBar(); DrawViewRect(contentsDrawer); if (targetScrollTo.HasValue) { DoScrollToTarget(); } }