当前位置: 首页 > news >正文

布吉网站设计网站清除黑链

布吉网站设计,网站清除黑链,seowhy问答,怀安县建设局网站这个工具主要是用于动态生成UI的情况。项目中我们通过配置UI的锚点、位置以及大小(位置、大小都是通过蓝湖看到的)#xff0c;然后通过代码动态生成UI。 大部分情况下只要合理设置锚点#xff0c;那么生成出来的UI就已经满足了适配的要求。 using UnityEngine;public static…这个工具主要是用于动态生成UI的情况。项目中我们通过配置UI的锚点、位置以及大小(位置、大小都是通过蓝湖看到的)然后通过代码动态生成UI。 大部分情况下只要合理设置锚点那么生成出来的UI就已经满足了适配的要求。 using UnityEngine;public static class RectTransUtility {/// summary/// 左上 (0.0, 1.0)/// /summarypublic static readonly Vector2 TopLeftVector new(0.0f, 1.0f);/// summary/// 上中 (0.5, 1.0)/// /summarypublic static readonly Vector2 TopCenterVector new(0.5f, 1.0f);/// summary/// 右上 (1.0, 1.0)/// /summarypublic static readonly Vector2 TopRightVector new(1.0f, 1.0f);/// summary/// 左中 (0.0, 0.5)/// /summarypublic static readonly Vector2 MiddleLeftVector new(0.0f, 0.5f);/// summary/// 中心 (0.5, 0.5)/// /summarypublic static readonly Vector2 MiddleCenterVector new(0.5f, 0.5f);/// summary/// 右中 (1.0, 0.5)/// /summarypublic static readonly Vector2 MiddleRightVector new(1.0f, 0.5f);/// summary/// 左下 (0.0, 0.0)/// /summarypublic static readonly Vector2 BottomLeftVector new(0.0f, 0.0f);/// summary/// 下中 (0.5, 0.0)/// /summarypublic static readonly Vector2 BottomCenterVector new(0.5f, 0.0f);/// summary/// 右下 (1.0, 0.0)/// /summarypublic static readonly Vector2 BottomRightVector new(1.0f, 0.0f);/// summary/// 设置位置与大小/// /summarypublic static void SetRTPosition(RectTransform rt, ERectTransAnchor anchor_pivot, float x, float y, float width, float height){//设置锚点和轴心点SetRTAnchorAndPivot(rt, anchor_pivot);switch (anchor_pivot){case ERectTransAnchor.TopLeft:rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, x, width);rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, y, height);return;case ERectTransAnchor.TopCenter:rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, y, height);rt.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width);rt.anchoredPosition new Vector2(x, rt.anchoredPosition.y);return;case ERectTransAnchor.TopRight:rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Right, x, width);rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, y, height);return;case ERectTransAnchor.MiddleLeft:rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, x, width);rt.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);rt.anchoredPosition new Vector2(rt.anchoredPosition.x, y);return;case ERectTransAnchor.MiddleCenter:rt.sizeDelta new Vector2(width, height);rt.anchoredPosition new Vector2(x, y);return;case ERectTransAnchor.MiddleRight:rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Right, x, width);rt.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);rt.anchoredPosition new Vector2(rt.anchoredPosition.x, y);return;case ERectTransAnchor.BottomLeft:rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, x, width);rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Bottom, y, height);return;case ERectTransAnchor.BottomCenter:rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Bottom, y, height);rt.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width);rt.anchoredPosition new Vector2(x, rt.anchoredPosition.y);return;case ERectTransAnchor.BottomRight:rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Right, x, width);rt.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Bottom, y, height);return;}Debug.LogWarning([RectTransUtility.SetRTPosition] 暂不支持的锚点类型);}/// summary/// 设置锚点和轴心点/// /summarypublic static void SetRTAnchorAndPivot(RectTransform rt, ERectTransAnchor anchor_pivot){switch (anchor_pivot){case ERectTransAnchor.TopLeft:rt.anchorMin TopLeftVector;rt.anchorMax TopLeftVector;rt.pivot TopLeftVector;return;case ERectTransAnchor.TopCenter:rt.anchorMin TopCenterVector;rt.anchorMax TopCenterVector;rt.pivot TopCenterVector;return;case ERectTransAnchor.TopRight:rt.anchorMin TopRightVector;rt.anchorMax TopRightVector;rt.pivot TopRightVector;return;case ERectTransAnchor.MiddleLeft:rt.anchorMin MiddleLeftVector;rt.anchorMax MiddleLeftVector;rt.pivot MiddleLeftVector;return;case ERectTransAnchor.MiddleCenter:rt.anchorMin MiddleCenterVector;rt.anchorMax MiddleCenterVector;rt.pivot MiddleCenterVector;return;case ERectTransAnchor.MiddleRight:rt.anchorMin MiddleRightVector;rt.anchorMax MiddleRightVector;rt.pivot MiddleRightVector;return;case ERectTransAnchor.BottomLeft:rt.anchorMin BottomLeftVector;rt.anchorMax BottomLeftVector;rt.pivot BottomLeftVector;return;case ERectTransAnchor.BottomCenter:rt.anchorMin BottomCenterVector;rt.anchorMax BottomCenterVector;rt.pivot BottomCenterVector;return;case ERectTransAnchor.BottomRight:rt.anchorMin BottomRightVector;rt.anchorMax BottomRightVector;rt.pivot BottomRightVector;return;}Debug.LogWarning([RectTransUtility.SetRTAnchorAndPivot] 暂不支持的锚点类型);}/// summary/// 设置背景填充/屏幕填充/// /summary/// param nameself/param/// param nameleft离左边的距离(距离为正)/param/// param namebottom离底部的距离(距离为正)/param/// param nameright离右边的距离(距离为负)/param/// param nametop离顶部的距离(距离为负)/param/// returns/returnspublic static RectTransform BgFill(this RectTransform self, float left 0f, float bottom 0f, float right 0f, float top 0f){self.anchorMin RectTransUtility.BottomLeftVector;self.anchorMax RectTransUtility.TopRightVector;self.offsetMin new Vector2(left, bottom);self.offsetMax new Vector2(right, top);return self;}/// summary/// 锚点类型/// /summarypublic enum ERectTransAnchor{/// summary/// 左上/// /summaryTopLeft 0,/// summary/// 上中/// /summaryTopCenter 1,/// summary/// 右上/// /summaryTopRight 2,/// summary/// 左中/// /summaryMiddleLeft 3,/// summary/// 中心/// /summaryMiddleCenter 4,/// summary/// 右中/// /summaryMiddleRight 5,/// summary/// 左下/// /summaryBottomLeft 6,/// summary/// 下中/// /summaryBottomCenter 7,/// summary/// 右下/// /summaryBottomRight 8} }
http://www.hkea.cn/news/14393612/

相关文章:

  • 乐清网站制作推广国外做自动化网站
  • ucenter使用自己做的网站福田蒙派克e
  • 网站建设 李奥贝纳龙岩网络巨头
  • 高要市建设局网站东莞企业响应式网页设计
  • 搭建一个论坛网站网站发展规划
  • 网站运营策划ppt泰州哪家网做网站
  • 网站建设一般花多少费用app开发与制作公司
  • wordpress 创建网站玩具网站 下载
  • 企业网站建设进什么科目核算营销型网站建设_做网站
  • 国外源代码网站dw做网页的步骤和代码
  • 朝阳网站建设 国展wordpress 主题 love
  • 建设好网站外链有哪些方式海宁市住房和城乡规划建设局网站
  • 做网站是怎样赚钱的关于一学一做的短视频网站好
  • 怎么提高网站收录量网站和新媒体建设审批制度
  • 网站域名备案资料织梦xml网站地图
  • 拱墅区做网站amh安装wordpress
  • 黑龙江建设厅网站官网wordpress 缩略图不显示
  • 2021能打开的网站免费政务网站集约化建设推进情况
  • 如何做背景不动的网站技术共享平台
  • 企业网站源码程序多少钱?怎么做网页聊天室
  • 吉 360 网站建设做网站是什么鬼
  • 城镇建设部网站小程序下单
  • 合肥网站建设工作室绥中网站建设分类信息网
  • wordpress全站静态cdn塘厦镇网站仿做
  • 茂名模板建站代理餐饮品牌设计项目
  • 做ktv的网站产品设计作品
  • 免费申请网站永久wordpress 企业小程序
  • 上海网站建设官网dw网页制作成品代码加图片
  • 创业公司做网站郑州网站推
  • 做网站都是怎么收费aspaccess做网站