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

做网站买空间用共享ipwordpress能恢复数据库

做网站买空间用共享ip,wordpress能恢复数据库,网站建设需要提供那些资料,网站开发的设计与实现Unity 使用任意一个局部轴指向目标 效果#xff1a; 主要用于在编辑器中可视化对象的朝向#xff0c;同时提供了选择不同轴向的功能。在运行时#xff0c;物体将根据所选择的轴向朝向目标#xff0c;并在 Scene 视图中绘制一个带箭头的圆环。 定义轴向枚举#xff1a;…Unity 使用任意一个局部轴指向目标 效果 主要用于在编辑器中可视化对象的朝向同时提供了选择不同轴向的功能。在运行时物体将根据所选择的轴向朝向目标并在 Scene 视图中绘制一个带箭头的圆环。 定义轴向枚举 public enum OnlyAxis {x_Axis,y_Axis,z_Axis }这是一个用于表示轴向的枚举包括 x 轴、y 轴和 z 轴。 定义变量 public Transform target; // 要指向的目标物体 [Header(追踪轴向)] public OnlyAxis Axis OnlyAxis.x_Axis; // 选择旋转的轴向 private OnlyAxis CurrentAxis OnlyAxis.x_Axis; // 当前轴向target: 用于指定需要朝向的目标物体。Axis: 用于在 Inspector 窗口中选择旋转的轴向。CurrentAxis: 用于在运行时跟踪当前的轴向。 主要计算 private void Update() {SetAxis(Axis);// 获取目标方向Vector3 targetDirection target.position - transform.position;Vector3 RotateAxis transform.up;// 根据选择的轴向获取目标方向在对应轴上的投影Vector3 axisDirection Vector3.zero;switch (CurrentAxis){case OnlyAxis.x_Axis:axisDirection Vector3.ProjectOnPlane(targetDirection, transform.right);break;case OnlyAxis.y_Axis:axisDirection Vector3.ProjectOnPlane(targetDirection, transform.up);break;case OnlyAxis.z_Axis:axisDirection transform.forward;Vector3 dirTemp transform.forward.normalized;RotateAxis Vector3.ProjectOnPlane(targetDirection, dirTemp);break;}// 计算旋转角度Quaternion newRotation Quaternion.LookRotation(axisDirection, RotateAxis);transform.rotation newRotation; } SetAxis 方法用于在运行时更新 CurrentAxis确保在不同的轴向之间正确切换。在 Update 方法中获取目标方向并根据当前选择的轴向计算相应的旋转。最后将物体的旋转设为新的旋转。 OnDrawGizmosSelected 方法仅在编辑器中生效 #if UNITY_EDITORprivate void OnDrawGizmosSelected(){DrawCircle();}public bool is3DDraw false;public float radius 0.1f;public float arrowLength 0.01f;int segments 20;private void DrawCircle(){float Radius is3DDraw ? radius : radius * Vector3.Distance(transform.position, SceneView.lastActiveSceneView.camera.transform.position);float ArrowLength is3DDraw ? arrowLength : arrowLength * Vector3.Distance(transform.position, SceneView.lastActiveSceneView.camera.transform.position);Gizmos.color Color.green;Vector3 center transform.position;Quaternion rotation transform.rotation;float angleIncrement 360f / segments;for (int i 0; i segments; i){float angle i * angleIncrement;Vector3 point Vector3.zero;float nextAngle (i 1) * angleIncrement;Vector3 nextPoint Vector3.zero;// 根据所选轴向调整旋转switch (Axis){case OnlyAxis.x_Axis:point center rotation * Quaternion.Euler(angle, 0, 0) * (Vector3.up * Radius);nextPoint center rotation * Quaternion.Euler(nextAngle, 0, 0) * (Vector3.up * Radius);if (i 0){Gizmos.DrawLine(nextPoint, center rotation * Quaternion.Euler(angle angleIncrement / 2, 0, 0) * (Vector3.up * (Radius ArrowLength)));Gizmos.DrawLine(nextPoint, center rotation * Quaternion.Euler(angle angleIncrement / 2, 0, 0) * (Vector3.up * (Radius - ArrowLength)));}break;case OnlyAxis.y_Axis:point center rotation * Quaternion.Euler(0, angle, 0) * (Vector3.right * Radius);nextPoint center rotation * Quaternion.Euler(0, nextAngle, 0) * (Vector3.right * Radius);if (i 0){Gizmos.DrawLine(nextPoint, center rotation * Quaternion.Euler(0, angle angleIncrement / 2, 0) * (Vector3.right * (Radius ArrowLength)));Gizmos.DrawLine(nextPoint, center rotation * Quaternion.Euler(0, angle angleIncrement / 2, 0) * (Vector3.right * (Radius -ArrowLength)));}break;case OnlyAxis.z_Axis:point center rotation * Quaternion.Euler(0, 0, angle) * (Vector3.right * Radius);nextPoint center rotation * Quaternion.Euler(0, 0, nextAngle) * (Vector3.right * Radius);if (i 0){Gizmos.DrawLine(nextPoint, center rotation * Quaternion.Euler(0, 0, angle angleIncrement / 2) * (Vector3.right * (Radius ArrowLength)));Gizmos.DrawLine(nextPoint, center rotation * Quaternion.Euler(0, 0, angle angleIncrement / 2) * (Vector3.right * (Radius -ArrowLength)));}break;}if (i ! 1) Gizmos.DrawLine(point, nextPoint);}} #endifOnDrawGizmosSelected 方法用于在 Scene 视图中绘制圆环。DrawCircle 方法根据选择的轴向绘制一个圆环并在第一个点上画一个箭头。 点击下载Demo
http://www.zqtcl.cn/news/966103/

相关文章:

  • 南昌网站建设公务手工制作代加工接单网
  • 排名好的手机网站建设你知道吗 网站
  • 网站信息组织优化成都网站制作计划
  • 网站网页背景颜色 多彩做搜狗网站点击赚钱
  • 门户网站开发 系统介绍wordpress 代码在哪
  • 石家庄网站设计建设门面设计效果图
  • 公司设计网站多少钱月子中心网站设计
  • 网站悬浮微信二维码手机端网站优化排名seo推广
  • 房地产公司网站建设乡村建设规划网站
  • 有没有做高仿手表的网站商会网站模板
  • 网站建设小组网页微博
  • org域名做商业网站弹出快捷菜单一般通过
  • wordpress模板的网站_网页字体怎么修改?网站权重怎么查询
  • 企业门户网站的建设与实现论文莲花直播
  • 做网站公司需要什么职位临沂seo代理商
  • 网站建设和发布的一般流程图wordpress 后端
  • 西安哪有学做淘宝网站html企业网站源码
  • 网站成品超市核心关键词是什么意思
  • 为什么自己花钱做的网站竟然不是自己的 (wordpress排版工具
  • 2017优惠券网站怎么做坪山网站建设特色
  • wordpress 多站点模式望江网站建设
  • 常熟网站制作哪家好平面素材设计网站
  • 网站建设客户怎么找网站建设开发软件
  • 青岛制作企业网站的公司怎么清空WordPress
  • 权重的网站所有网站302跳转百度
  • 做个淘宝客网站怎么做济南网络推广公司排名
  • 西宁网站建设优化东莞建网站公司案例
  • 建设网站iss手工活接单在家做有正规网站吗
  • 六安做网站的公司专门建立网站的公司吗
  • 西昌市建设工程管理局网站wordpress主题知更