using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class checkSize : MonoBehaviour { public int lg = 1; // Update is called once per frame void Update() { int w =750; if(GetTexture2D.urlbase.Contains("329")) { this.GetComponent().sizeDelta = new Vector2(this.GetComponentsInChildren().Length*w/ lg, 450); if(w*6>(this.GetComponentsInChildren().Length*w/ lg)) { this.GetComponent().sizeDelta = new Vector2(w*6, 450); } else { } } else { if(700*6>(this.GetComponentsInChildren().Length*w/ lg)) { this.GetComponent().sizeDelta = new Vector2(w*6, 900); } else { this.GetComponent().sizeDelta = new Vector2(this.GetComponentsInChildren().Length*w/ lg, 900); } } } }