在Unity里画出鼠标位置的代码是这样的:
OnGU()
{
Vector3 mousePos = Input.mousePosition;
Rect newMuoseIcon = new Rect(mousePos.x - mouseTexture.width*0.5f,
Screen.height - mousePos.y - mouseTexture.height*0.5f,
mouseTexture.width,
mouseTexture.height);
}
我想知道的是,为什么计算Y轴坐标的时候要用屏幕坐标减去鼠标的坐标呢?