Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hitinfo;
RaycastHit hitinfo;
bool isCollider = Physics.Raycast(ray, out hitinfo);
简单屏幕点转射线
鼠标指针图标
public Texture2D cursor_pick;
private Vector2 hotspot = Vector2.zero;
private CursorMode mode = CursorMode.Auto;
public void SetNpcTalk()
{
Cursor.SetCursor(cursor_pick, hotspot, mode);
}
//可编写多个设置鼠标指针图标方法