using System.Collections; using System.Collections.Generic; using UnityEngine; public class WidthCheckerFixer : MonoBehaviour { public float requredWidth = 100; public RectTransform rectTransform; private void OnEnable() { if(rectTransform.GetWidth() <= 0) { rectTransform.SetWidth(requredWidth); } } }