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

建设网站查证书做网站可以用哪些软件

建设网站查证书,做网站可以用哪些软件,浏览器加速器免费版,建设一个百度百科类网站描述 点击鼠标左键在屏幕上绘制线段 准备 VertexHelper 网格绘制工具类向量、叉乘RectTransformUtility.ScreenPointToLocalPointInRectangleSetVerticesDirtyOnPopulateMesh 思路 鼠标按下#xff0c;记录线段起点#xff1b;鼠标持续按下#xff0c;记录鼠标当前帧的…描述 点击鼠标左键在屏幕上绘制线段 准备 VertexHelper 网格绘制工具类向量、叉乘RectTransformUtility.ScreenPointToLocalPointInRectangleSetVerticesDirtyOnPopulateMesh 思路 鼠标按下记录线段起点鼠标持续按下记录鼠标当前帧的移动向量使用叉乘获取垂直与移动向量的单位向量根据设置的宽度获取四个顶点设置顶点脏数据,更新网格 示例 新建脚本继承MaskableGraphic 创建一个Image,移除Image组件添加新建脚本。 脚本内容如下 引入命名空间 using UnityEngine; using UnityEngine.UI; using System.Collections.Generic;属性 private ListListUIVertex vertexList new ListListUIVertex();//缓存线段上的网格顶点 private Vector3 lastPoint;//上一帧的点击点 private Vector3 lastLeftPoint; private Vector3 lastRightPoint; bool isNewLine;//绘制新的线段 [SerializeField] private float lineWidth 4f;//线段宽度方法 绘制网格 protected override void OnPopulateMesh(VertexHelper vh)//绘制网格 {vh.Clear();for (int i 0; i vertexList.Count; i)vh.AddUIVertexQuad(vertexList[i].ToArray()); }方法 屏幕坐标转为本地坐标 Vector2 ScreenPointToLocalPoint(Vector2 mousePoint) {var Rect GetComponentRectTransform();Vector2 result Vector2.zero;switch (canvas.renderMode){case RenderMode.ScreenSpaceOverlay:RectTransformUtility.ScreenPointToLocalPointInRectangle(Rect, mousePoint, null, out result);break;case RenderMode.ScreenSpaceCamera:RectTransformUtility.ScreenPointToLocalPointInRectangle(Rect, mousePoint, canvas.worldCamera, out result);break;case RenderMode.WorldSpace:RectTransformUtility.ScreenPointToLocalPointInRectangle(Rect, mousePoint, canvas.worldCamera, out result);break;}return result; }方法 设置网格顶点 private void Update() {if (Input.GetMouseButtonDown(0))//按下鼠标坐标表示 绘制新的线段{lastPoint ScreenPointToLocalPoint(Input.mousePosition);//屏幕点转换到当前recttransform上的点isNewLine true;vertexList.Clear();//清除上一次绘制的线段 若要保留 可不清除}else{if (Input.GetMouseButton(0)){Vector3 currentPoint ScreenPointToLocalPoint(Input.mousePosition);Vector3 dir currentPoint - lastPoint;//移动向量if (dir.magnitude 10)//移动量过小 不绘制网格return;Vector3 normal Vector3.Cross(dir.normalized, transform.forward);//移动向量和当前ui的朝向 进行叉乘if (isNewLine){isNewLine false;lastLeftPoint lastPoint normal * lineWidth;//绘制新的线段时 作为左侧起点lastRightPoint lastPoint - normal * lineWidth;}Vector3 leftPoint currentPoint normal * lineWidth;//当前线段的左侧终点Vector3 rightPoint currentPoint - normal * lineWidth;ListUIVertex ver new ListUIVertex();UIVertex uIVertex new UIVertex();//网格顶点列表uIVertex.position lastLeftPoint;uIVertex.color color;ver.Add(uIVertex);UIVertex uIVertex2 new UIVertex();uIVertex2.position lastRightPoint;uIVertex2.color color;ver.Add(uIVertex2);UIVertex uIVertex3 new UIVertex();uIVertex3.position rightPoint;uIVertex3.color color;ver.Add(uIVertex3);UIVertex uIVertex4 new UIVertex();uIVertex4.position leftPoint;uIVertex4.color color;ver.Add(uIVertex4);vertexList.Add(ver);lastLeftPoint leftPoint;//更新起点 当前帧的终点作为下一帧的起点lastRightPoint rightPoint;lastPoint currentPoint;SetVerticesDirty();//设置顶点脏数据 更新网格}} }
http://www.hkea.cn/news/14321584/

相关文章:

  • 新加坡购物网站排名Wordpress屏蔽模仿站爬虫ip
  • 服装加工厂网站建设方案计划书东莞房产信息网官网
  • 网站建设com网站域名有了怎么做网站
  • 网站地图怎么做的网页设计心得体会免费
  • 帮企业建设网站保密合同wordpress分享qq
  • 手机网站建设报价多少wordpress免费建站吗
  • 一个人做网站的难度网站模板的功能
  • 山东网站建设服务企业网站建设一条龙多少钱
  • 网站优化seo培网站作业免费下载
  • logo素材库网站免费淘宝关键词排名查询网站
  • 巴彦淖尔专业做网站的教育视频网站开发
  • 基于php网站开发设计上海热点事件
  • 做推广网站那里好上海网站排名优化怎么做
  • 做公司网站,哪个程序用的多app开发费用标准
  • 做网站的项目职责怎么写网站推广途径方法
  • 惠州网站制作培训城乡建设网站职业查询
  • 医疗类网站建设网站建设公司每年可以做多少个网站
  • 接做网站需要问什么条件ajax jsp网站开发从入门到精通
  • kali钓鱼网站制作商城网站怎么自己搭建
  • 公司网站设计报价重庆今天刚刚发生的新闻事件
  • 网站建设的编程技术wordpress 导航特效
  • 域名绑了小程序还可以做网站吗开发手机端网站模板
  • 网站留言功能排名优化公司好不好
  • 网站优化文档wordpress 用户分组
  • 张家港手机网站当下最流行的营销方式
  • HTML5怎么做自适应网站c 做特产网站
  • 建站技术布局方式wordpress 免费 模板
  • 番禺网站建设优化北京高端网站建设规划
  • 在南宁做家教兼职的网站一二三四免费观看高清视频
  • 电商站点是什么意思photoshop 做网站logo