【小松教你手遊開發】【unity實用技能】重置scrollpanel

chrisfxs發表於2015-11-23
bool originalKeepWithinPanel = _itemGrid.keepWithinPanel;
_itemGrid.keepWithinPanel = false;  //Need to set this to false or else buttons will not properly be at top if player scrolls past bottom then switch tabs

_scrollView.ResetPosition (); //Reset and move scroll panel back to original start position or else buttons keep shifting when changing tabs

_itemGrid.Reposition();
_scrollView.ResetPosition (); //Reset and move scroll panel back to original start position, required before and after tabbing - see ngui docs
_itemGrid.keepWithinPanel = originalKeepWithinPanel;

相關文章