为什么unity中使用Screen.showCusor=false之后鼠标中game视图下依然显示呢?
代码是这样的:varmycusor:Texture2D;varmyclickcusor:Texture2D;varwidth:float;varheight:float;...
代码是这样的:
var mycusor:Texture2D;
var myclickcusor:Texture2D;
var width:float;
var height:float;
private var isclick:boolean=false;
function Start () {
Screen.showCursor=false;
}
function Update () {
if(Input.GetMouseButton(0))
isclick=true;
else
isclick=false;
}
function OnGUI()
{
if(isclick)
GUI.DrawTexture(Rect(Input.mousePosition.x-width/2,(Screen.height-Input.mousePosition.y)-height/2.0,width,height),myclickcusor);
else
GUI.DrawTexture(Rect(Input.mousePosition.x-width/2,(Screen.height-Input.mousePosition.y)-height/2.0,width,height),mycusor);
}
不好意思了,实在没有财富值了,又急需解决,希望大家可以帮忙,谢谢大家 展开
var mycusor:Texture2D;
var myclickcusor:Texture2D;
var width:float;
var height:float;
private var isclick:boolean=false;
function Start () {
Screen.showCursor=false;
}
function Update () {
if(Input.GetMouseButton(0))
isclick=true;
else
isclick=false;
}
function OnGUI()
{
if(isclick)
GUI.DrawTexture(Rect(Input.mousePosition.x-width/2,(Screen.height-Input.mousePosition.y)-height/2.0,width,height),myclickcusor);
else
GUI.DrawTexture(Rect(Input.mousePosition.x-width/2,(Screen.height-Input.mousePosition.y)-height/2.0,width,height),mycusor);
}
不好意思了,实在没有财富值了,又急需解决,希望大家可以帮忙,谢谢大家 展开
2个回答
2017-08-21
展开全部
Cursor.visible = false;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询