- 最后登录
- 2019-9-4
- 注册时间
- 2013-3-4
- 阅读权限
- 70
- 积分
- 3710
 
- 纳金币
- 776
- 精华
- 0
|
Unity不支持设置鼠标坐标,这个只读的。
在 window系统,可以调用系统API实现 设置鼠标坐标。如:
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class NewBehaviourScript : MonoBehaviour {
[DllImport("user32.dll")]
public static extern int SetCursorPos(int x, int y);
// Use this for initialization
void Start () {
//设置鼠标坐标
SetCursorPos(1, 1);
}
// Update is called once per frame
void Update () {
}
}
|
|