using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices; // 記得匯入

public class MouseControl : MonoBehaviour {

    [DllImport("user32")] // 使用 user32.dll ,這是系統的 Dll 檔,所以Unity會自動匯入,不用再手動加入 dll 檔
    static extern bool SetCursorPos(int X, int Y);

    void Start () {
        // 遊戲啟動後,會強制移動滑鼠到左上角。我這裡設定為: X = 0 、Y = 0,開發者可依需求設定移動座標。
        SetCursorPos(0, 0);
    }
}

 

 

 

 

「カルマルカ*サークル」応援中!

 

arrow
arrow
    全站熱搜

    黃彥霖 發表在 痞客邦 留言(0) 人氣()