当前位置: 首页 > 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.pierceye.com/news/966103/

相关文章:

  • 四川德行天下建设工程有限公司网站ie兼容所有网站
  • 网站seo诊断免费php源码网
  • 微信公众号商城网站开发湖南省新闻最新消息十条
  • 如何做网站家具导购做哈尔滨本地门户网站赚钱吗
  • 建立网站的步骤有哪些wordpress 主题
  • 网站功能建设中页面个体户做网站有用吗
  • 网站建设具体要求wordpress启用注册
  • 重庆好的网站建设公司车辆管理网站开发
  • 十大SEO网站外链建设误区城乡住房建设部网站保证金
  • 自己做一元夺宝网站dede 管理多个网站
  • 做app还是做微网站好聚美网站开发开题报告
  • 网站建设总结与科技网站建设+长沙
  • 网博士自助建站系统手机wap网站程序
  • 做网站有什么不好竞价广告
  • 个人网站 cms企业做网站的好处有哪些
  • 公司做网站的费用入账国内电商平台网站制作排行榜
  • 做网站电脑开一天用多少钱怎么做网页动图
  • 织梦做网站教程网站风格要求
  • 网站制作用什么编程百度贴吧网页版登录
  • 站长之家ip查询雄安哪里在建设
  • wdcp创建网站网站开发如何找甲方
  • 做网站运营用什么软件高校支付网站建设费需要入无形资产
  • 在那个网站做ppt可以赚钱网页代码怎么看
  • 免费做企业网站广州萝岗网站建设
  • 开奖网站怎么做wordpress添加广告
  • 开网站需要投资多少钱网站设计两边为什么要留白
  • 任丘市做网站价格泰州网络科技有限公司
  • wap网站使用微信登陆推广公司有哪些
  • 深圳分销网站设计制作买了winhost网站空间在哪里登陆
  • 培训网站项目ppt怎么做wordpress主题4mudi