|
本帖最后由 小彬彬 于 2012-8-11 11:17 编辑
[code=javascript]
//用指定图片替换鼠标指针
var mouse:Texture;
function Update(){
Screen.showCursor=false;//隐藏鼠标指针
}
function OnGUI(){
var msPos=Input.mousePosition;//鼠标的位置
GUI.DrawTexture(Rect(msPos.x,Screen.height-msPos.y,20,20),mouse);
}
本脚本要发布后才可以测试
移到物体上换鼠标
var mouse:Texture;
var mousea:Texture;
var mouseb:Texture;
function Update(){
Screen.showCursor=false;
}
function OnMouseOver () {
mouse = mousea;
}
function OnMouseExit () {
mouse = mouseb;
}
function OnGUI(){
var msPos=Input.mousePosition;
GUI.DrawTexture(Rect(msPos.x,Screen.height-msPos.y,20,20),mouse);
}
[/code] |
|