物体拖拽最简实现
using UnityEngine; [RequireComponent(typeof(Collider))] public class CardTouch : MonoBehaviour { private void onm ouseDrag() { var mousePos = Input.mousePosition; mousePos.z = 10; // select distance = 10 units from the camera transform.position = Camera.main.ScreenToWorldPoint(mousePos); } }
标签:mousePos,常用,Collider,10,代码,最简 From: https://www.cnblogs.com/sanyejun/p/17088510.html