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

一个综合网站上线多少钱wordpress粘贴word

一个综合网站上线多少钱,wordpress粘贴word,双网建筑工程资质公司,中小企业网络规划与设计论文1、创建一个空物体#xff0c;挂载Rigidbody组件#xff0c;并设置相应参数 2、在上述空物体下创建一个胶囊体#xff0c;两个空物体#xff0c;一个用来控制朝向#xff0c;另一个用来控制摄像机 3、给摄像机创建一个父物体#xff0c;并挂载脚本MoveCamera_01.cs using…1、创建一个空物体挂载Rigidbody组件并设置相应参数 2、在上述空物体下创建一个胶囊体两个空物体一个用来控制朝向另一个用来控制摄像机 3、给摄像机创建一个父物体并挂载脚本MoveCamera_01.cs using System.Collections; using System.Collections.Generic; using UnityEngine;public class MoveCamera_01 : MonoBehaviour {public Transform cameraPosition;private void Update(){transform.position cameraPosition.position;} }4、给摄像机挂载脚本PlayerCam_01.cs using System.Collections; using System.Collections.Generic; using UnityEngine;public class PlayerCam_01 : MonoBehaviour {// 视觉灵敏度参数public float sensX 400;public float sensY 400;// 视角垂直旋转角度限制public float minAngle -90f;public float maxAngle 90f;// 角色朝向的 Transform用于水平旋转public Transform orientation;// 当前的 X 和 Y 旋转角度private float xRotation;private float yRotation;private void Start(){// 初始时锁定鼠标光标并隐藏光标Cursor.lockState CursorLockMode.Locked;Cursor.visible false;}private void Update(){// 获取鼠标输入float mouseX Input.GetAxisRaw(Mouse X) * Time.deltaTime * sensX;float mouseY Input.GetAxisRaw(Mouse Y) * Time.deltaTime * sensY;// 更新水平旋转角度yRotation mouseX;// 更新垂直旋转角度并限制在指定范围内xRotation - mouseY;xRotation Mathf.Clamp(xRotation, minAngle, maxAngle);// 应用旋转到摄像机的 Transform 上实现视角旋转transform.rotation Quaternion.Euler(xRotation, yRotation, 0);// 应用水平旋转到角色的 Transform 上使角色朝向与摄像机一致orientation.rotation Quaternion.Euler(0, yRotation, 0);} }5、给主角挂载脚本PlayerMovement_01.cs using System.Collections; using System.Collections.Generic; using UnityEngine;public class PlayerMovement_01 : MonoBehaviour {public float moveSpeed 7; // 玩家移动速度public float groundDrag 5; // 地面时的阻力public float playerHeight 2; // 玩家身高public LayerMask whatIsGround; // 地面的LayerMaskprivate bool grounded; // 是否在地面上public float jumpForce 6; // 跳跃力度public float jumpCooldown 0.25f; // 跳跃冷却时间public float airMultiplier 0.4f; // 空中移动速度衰减private bool readyToJump true; // 是否可以跳跃public KeyCode jumpKey KeyCode.Space; // 跳跃键public Transform orientation; // 玩家朝向的Transformprivate float h; // 水平输入private float v; // 垂直输入private Vector3 moveDirection; // 移动方向private Rigidbody rb; // 玩家刚体private void Start(){rb GetComponentRigidbody();rb.freezeRotation true; // 防止刚体旋转}private void Update(){grounded Physics.Raycast(transform.position, Vector3.down, playerHeight * 0.5f 0.2f, whatIsGround);MyInput();SpeedControl();if (grounded)rb.drag groundDrag;elserb.drag 0;}private void FixedUpdate(){MovePlayer();}private void MyInput(){h Input.GetAxisRaw(Horizontal);v Input.GetAxisRaw(Vertical);if (Input.GetKey(jumpKey) readyToJump grounded){readyToJump false;Jump();Invoke(nameof(ResetJump), jumpCooldown);}}private void MovePlayer(){// 根据朝向计算移动方向moveDirection orientation.forward * v orientation.right * h;if (grounded){rb.AddForce(moveDirection.normalized * moveSpeed * 10f, ForceMode.Force);}else if (!grounded){rb.AddForce(moveDirection.normalized * moveSpeed * 10f * airMultiplier, ForceMode.Force);}}private void SpeedControl(){Vector3 flatVel new Vector3(rb.velocity.x, 0f, rb.velocity.z);if (flatVel.magnitude moveSpeed){// 限制速度在设定范围内Vector3 limitedVel flatVel.normalized * moveSpeed;rb.velocity new Vector3(limitedVel.x, rb.velocity.y, limitedVel.z);}}private void Jump(){//rb.velocity new Vector3(rb.velocity.x, 0f, rb.velocity.z);rb.velocity Vector3.zero;// 添加向上的力以实现跳跃rb.AddForce(transform.up * jumpForce, ForceMode.Impulse);}private void ResetJump(){readyToJump true;} }
http://www.pierceye.com/news/263922/

相关文章:

  • 承接电商网站建设新手做自己的网站
  • 网页版视频网站建设需要多少钱四川鸿业建设集团公司网站
  • h5网站实例wordpress改造mip
  • 完整的网络营销推广方案包括优化营商环境心得体会个人
  • 商洛市住房和城乡建设局网站建免费网站
  • 做网站要多少的服务器网站设计的步骤
  • 网站关键词怎么做上首页wordpress 架构原理
  • 厦门专业网站建设代理国外在线crm系统suitecrm
  • 哪个网站可以领手工活在家做wordpress heroku
  • 为什么没有网站做图文小说电子商务网站开发的课程介绍
  • 在哪个网站做问卷好单页面网站推广
  • 专业网站建设模块维护静海网站建设
  • 国内前十网站建设公司龙之网官网
  • 昆山做网站的公昆山做网站的公司司网站开发与设计岗位职责
  • 网站投注员怎么做做旅游项目用哪家网站好
  • 环县网站怎么做咸阳网站开发公司地址
  • 重庆巴南网站制作wordpress外贸建站公司
  • 桂林旅游网站制作公司软件开发公司属于什么行业
  • 网站 备案 中国 名字老薛主机 wordpress
  • 有什么网站可以做投票功能合肥房地产交易网
  • 世界网站广西建设工程质检安全网站
  • 建设银行网站会员基本信息wordpress主题图片丢失
  • 找人做网站需要注意什么问题中国建设信用卡网站
  • 公众号制作的网站开发营销平台推广
  • 河源手机网站制作网站页面效果图怎么做
  • 公司网站建设要注意的问题wordpress上传图片x
  • 网站开发PHP留言本快代理
  • 温州做网站价格怎么做简易手机网站
  • 东营网站建设制作广州物流网站建设
  • 新乡建设工程信息网站kindeditor wordpress