unity, get Canvas Scaler referenceResolution

需要using UnityEngine.UI;

然后就可以访问到CanvasScaler组件。

float width=GetComponent<CanvasScaler> ().referenceResolution.x

float height=GetComponent<CanvasScaler> ().referenceResolution.y

posted on 2015-08-07 18:08  wantnon  阅读(1459)  评论(0编辑  收藏  举报

导航