纳金网
标题:
关于多触点过界的问题
[打印本页]
作者:
她。
时间:
2013-1-30 09:04
标题:
关于多触点过界的问题
帮看看下面的程序:多触点问题。
function Touchs()
{
for(var touch : Touch in Input.touches)
{
for(var i = 0;i < Input.touchCount; ++i)
{
if(touch.position.x >380 && touch.position.x <480 && touch.position.y > 0 && touch.position.y < 70)
{
if(Input.touchCount > 0 && touch.phase == TouchPhase.Moved)
{....}
else if(touch.phase != TouchPhase.Moved)
{....}
}
if(touch.position.x >0 && touch.position.x <43 && touch.position.y > 0 && touch.position.y < 80)
{
if(touch.phase == TouchPhase.Began)
{....}
if(touch.phase == TouchPhase.Ended)
{...}
}
}
}
}
结果在Began的时候,如果我按着移到边界以外再松手的时候会卡在Began上,检测不到Ended事件,求高手指点下
欢迎光临 纳金网 (http://go.narkii.com/club/)
Powered by Discuz! X2.5