标签:tran 获取 for type roo game uip color panel
using UnityEngine; private float ratio = 1f; private float panelW; private float panelH; UIRoot root = GameObject.FindObjectOfType<UIRoot>(); if (root != null) { // 实际尺寸和设计尺寸比例 ratio = (float)root.activeHeight / Screen.height; }
// 设计尺寸 panelW = transform.GetComponent<UIPanel>().width; panelH = transform.GetComponent<UIPanel>().height;
// 实际尺寸 width = panelW * ratio; height = panelH * ratio;
标签:tran 获取 for type roo game uip color panel
原文地址:http://www.cnblogs.com/Colored-Mr/p/6953609.html