unity获取点击的碰撞体

据说好像是用了射线,

 Collider2D[] col = Physics2D.OverlapPointAll(Camera.main.ScreenToWorldPoint(Input.mousePosition ));

你可能感兴趣的:(unity获取点击的碰撞体)