unity 中Canvas MatchHeight

设置了

UI Scale Mode = Scale With Screen Size,

Reference Resolution = X 1334, Y 750,

Screen Match Mode = Match Width Or Height,

Match = Width 0, Height 1,

---------------------------------------

获取屏幕实际宽度.(RectTransform 在Canvas中填满时的宽度)

         this.RealHeight = 750f;
this.RealWidth = this.RealHeight / (float)Screen.height * (float)Screen.width;
UnityEngine.Debug.LogFormat("real: width:{0} height:{1}", this.RealWidth, this.RealHeight);
上一篇:mac安装oh my zsh


下一篇:SELECT的解析顺序及慢查询优化