GridLayoutGroup
How do I use Grid Layout Group
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
42 |
this.cellSize = content.GetComponent |
1 |
File name: ScrollSnap.cs
Copy
33 protected override void Awake() {
34 base.Awake();
35 actualIndex = startingIndex;
36 cellIndex = startingIndex;
37 this.onLerpComplete = new OnLerpCompleteEvent();
38 this.onRelease = new OnReleaseEvent();
39 this.scrollRect = GetComponent
40 this.canvasGroup = GetComponent
41 this.content = scrollRect.content;
42 this.cellSize = content.GetComponent
43 content.anchoredPosition = new Vector2(-cellSize.x * cellIndex, content.anchoredPosition.y);
44 int count = LayoutElementCount();
45 SetContentSize(count);
46
47 if(startingIndex < count) {
48 MoveToIndex(startingIndex);
49 }
50 }
GridLayoutGroup 162 lượt xem
Gõ tìm kiếm nhanh...