Scroll view - stretch to canvas rather than hard coded size

This commit is contained in:
tverona1
2019-07-23 21:38:43 -07:00
parent 0e7fbaedc5
commit f85417e7cc
3 changed files with 1345 additions and 64 deletions
File diff suppressed because it is too large Load Diff
-11
View File
@@ -28,9 +28,6 @@ namespace QuestAppLauncher
// Canvas game object
public GameObject canvas;
// Scroll view game object
public GameObject scrollView;
// Grid content game object
public GameObject gridContent;
@@ -178,14 +175,6 @@ namespace QuestAppLauncher
// Adjust canvas rect transform
var canvasRectTransform = this.canvas.GetComponent<RectTransform>();
canvasRectTransform.sizeDelta = new Vector2(width, height);
// Adjust scroll view rect transform
var scrollViewRectTransform = this.scrollView.GetComponent<RectTransform>();
scrollViewRectTransform.sizeDelta = new Vector2(width, height);
// Adjust scroll view box collider
var scrollViewBoxCollider = this.scrollView.GetComponent<BoxCollider>();
scrollViewBoxCollider.size = new Vector3(width, height, 0);
}
/// <summary>
@@ -56,7 +56,7 @@ Material:
- _WeightNormal: 0
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
- _FaceColor: {r: 0.007843138, g: 0.08235294, b: 0.18039216, a: 1}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
--- !u!114 &11400000