- 最后登录
- 2013-9-29
- 注册时间
- 2012-8-20
- 阅读权限
- 90
- 积分
- 6371
- 纳金币
- 6372
- 精华
- 0
|
using UnityEngine;
using System.Collections;
public class Cursor : MonoBehaviour
{
// Use this for initialization
void Start()
{
//在游戏启动时就隐藏系统鼠标指针
Screen.showCursor = false;
}
// Update is called once per frame
void Update()
{
//实时修改自身的坐标,注意GUITexture的位置是以屏幕左下角为(0,0)点,右上角为(1,1)点
transform.position = new Vector3()
{
x = 1 - (Screen.width - Input.mousePosition.x) / Screen.width,
y = 1 - (Screen.height - Input.mousePosition.y) / Screen.height,
};
}
} |
|