/// <summary> /// 用指定贴图平铺指定矩形 /// </summary> public static void DrawTiledTexture(Rect rect, Texture texture) { using (GUI.GroupScope groupScope = new GUI.GroupScope(rect)) { int width = Mathf.RoundToInt(rect.width); int height = Mathf.RoundToInt(rect.height); for (int y = 0; y < height; y += texture.height) { for (int x = 0; x < width; x += texture.width) { GUI.DrawTexture(new Rect(x, y, texture.width, texture.height), texture); } } } }
private void DrawTracks(Rect windowPos) { Vector2 cursor = Border; foreach (var drawer in trackDrawers) { var size = new Vector2(drawer.Width, drawer.Height); var rect = new Rect(cursor, size); using (var groupScope = new GUI.GroupScope(rect)) { drawer.Update(); } cursor += new Vector2(0, rect.height + TrackSpacing); } }