- 博客(3)
- 资源 (2)
- 收藏
- 关注
原创 Unity3D学习-角色跳起-落地
1.变量float m_xDistance; float m_moveSpeed = 13; float m_yDistance; float gravity = 9.8f; float m_jumpValue = 5f;2.循环 IEnumerator UpdateAction() { while (true) { m_yDistance -= gravity;//加重力,好落地 ...
2022-02-07 16:58:02
2412
原创 Unity3D学习-相机跟踪
public class FollowPlayer : MonoBehaviour{ Transform m_player; float speed = 20; Vector3 m_offset; // Start is called before the first frame update private void Awake() { m_player = GameObject.FindWithTag(Tag.player).transf...
2022-02-07 10:27:32
2117
原创 Unity3D学习-如何判断鼠标移动方向
1. 定义public enum InputDirection{ NULL, Right, Left, Down, Up}2. 属性InputDirection m_inputDir = InputDirection.NULL; bool activeInput = false; Vector3 m_mousePos;3. 方法void GetInputDirection() { m_inputDir =...
2022-02-07 10:06:02
2732
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人