close
以下為計算NGUI中螢幕長寬的size:
//部分程式碼:---
public UIRoot uiRoot; //NGUI中2D攝影機上層的UIRoot
public static Vector2 GetUIScreenSize(UIRoot uiRoot){
float rate = (float)uiRoot.activeHeight / Screen.height;
Vector2 size;
size.x = Mathf.Ceil(Screen.width * rate);
size.y = Mathf.Ceil(Screen.height * rate);
return size;
}
//------------
文章標籤
全站熱搜
留言列表