using Sirenix.OdinInspector; using System.Collections; using System.Collections.Generic; using UnityEngine; public class ScaleContronl : MonoBehaviour { [LabelText("比例基准")] public float scaleBase; [LabelText("检测对象")] public RectTransform m_RectTransform; [LabelText("需要调整比例对象")] public RectTransform[] m_ChangeTransforms; /// /// 更新比例 /// public void UpdateScale() { float scale = m_RectTransform.sizeDelta.y / scaleBase; foreach (RectTransform t in m_ChangeTransforms) { t.localScale = new Vector3(t.localScale.x,scale,t.localScale.z); } } }