随笔分类 -  Unity / 移动

摘要:实现目标: 在Unity中实现第一人称跳跃功能,基于CharacterController组件 private float jumpSpeed; //跳跃速度 private bool isGround;//是否在地面 private bool verticalVelocity; //当前垂直速度 阅读全文
posted @ 2023-04-12 18:53 星空探险家 阅读(34) 评论(0) 推荐(0) 编辑
摘要:使用Rotate方法使物体旋转 实现方法 public void Rotate (Vector3 eulers)Rotate (Vector3 eulers, Space relativeTo= Space.Self) 旋转采用欧拉角形式的 Vector3 参数。旋转以欧拉角度数表示。Space r 阅读全文
posted @ 2023-03-26 18:45 星空探险家 阅读(29) 评论(0) 推荐(0) 编辑
摘要:简介 使用Translate方法使物体移动 实现方法 Translate (Vector3 translation);Translate (Vector3 translation, Space relativeTo= Space.Self);Translate (float x, float y, 阅读全文
posted @ 2023-03-26 17:58 星空探险家 阅读(22) 评论(0) 推荐(0) 编辑
摘要:实现在Unity中重新封装按键输入 1.创建脚本Input.cs //自定义轴 public class fps_InputAxis { public KeyCode positive; public KeyCode negative; } //自定义按键集合 public Dictionary<s 阅读全文
posted @ 2023-03-18 14:51 星空探险家 阅读(48) 评论(0) 推荐(0) 编辑
摘要://基于Unity实现第一人称视角相机跟随鼠标移动 private float xRotate = 0.0f; private float yRotate = 0.0f; Void Update { xRotate -= Input.GetAxis("Mouse Y"); yRotate += In 阅读全文
posted @ 2023-03-12 10:45 星空探险家 阅读(63) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示