|
用指定图片替换鼠标指针
//用指定图片替换鼠标指针- 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);
- }
复制代码 |
|