1.ui鼠标跟随
//跟随鼠标
Vector2 Position;
//这个方法是用来 把鼠标的坐标 转化成 画布的坐标
RectTransformUtility.ScreenPointToLocalPointInRectangle(canvas.transform as RectTransform, Input.mousePosition, null, out Position);
txtName.transform.localPosition = Position;
/ private Vector2 M_pos = new Vector2(20, -20);//增加的位移
txtName.transform.localPosition = Position + M_pos;
2.鼠标图片更换
//设置鼠标贴图 / 恢复默认贴图
Cursor.SetCursor(Resources.Load<Texture2D>("Mouse/shouzhi"), Vector2.zero, CursorMode.ForceSoftware);