[System.Runtime.InteropServices.DllImport("user32.dll")] //引入dll
public static extern int SetCursorPos ( int x , int y );

void Update()
{
  SetMouseToAnyOfScreenPosition();
}


void SetMouseToAnyOfScreenPosition()
{
  SetCursorPos ( 20 , 20 );//放在update中,每帧调用,强制设置坐标
  Cursor . visible = false;//隐藏鼠标
}

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-01-10
  • 2021-04-27
  • 2022-01-14
  • 2021-07-14
  • 2021-09-15
猜你喜欢
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案