1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 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<RectTransform>().sizeDelta = new Vector2(this.GetComponentsInChildren<RawImage>().Length*w/ lg, 450);
- if(w*6>(this.GetComponentsInChildren<RawImage>().Length*w/ lg))
- {
- this.GetComponent<RectTransform>().sizeDelta = new Vector2(w*6, 450);
- }
- else
- {
- }
- }
- else
- {
-
- if(700*6>(this.GetComponentsInChildren<RawImage>().Length*w/ lg))
- {
- this.GetComponent<RectTransform>().sizeDelta = new Vector2(w*6, 900);
- }
- else
- {
- this.GetComponent<RectTransform>().sizeDelta = new Vector2(this.GetComponentsInChildren<RawImage>().Length*w/ lg, 900);
- }
- }
- }
- }
|