标签:
需要using UnityEngine.UI;
然后就可以访问到CanvasScaler组件。
float width=GetComponent<CanvasScaler> ().referenceResolution.x
float height=GetComponent<CanvasScaler> ().referenceResolution.y
unity, get Canvas Scaler referenceResolution
标签:
原文地址:http://www.cnblogs.com/wantnon/p/4711573.html