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;
}
//------------
arrow
arrow
    文章標籤
    unity ngui
    全站熱搜

    WilsonYo 發表在 痞客邦 留言(0) 人氣()