📜  统一对象跟随鼠标 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:01.599000             🧑  作者: Mango

代码示例1
if (Input.GetMouseButton(1)) {
            mousePosition = Input.mousePosition;
            mousePosition = Camera.main.ScreenToWorldPoint(mousePosition);
            transform.position = Vector2.Lerp(transform.position, mousePosition, moveSpeed);
        }