如何禁用触摸检测? [英] How can I disable the touch detection?

查看:117
本文介绍了如何禁用触摸检测?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行的操作中禁用触摸检测,因为如果玩家点击并在操作中单击,我不希望人物在天空中飞行,就像超人一样,如果他们继续点击。
我发现方法isDone,是涉及到这个方法?
玩家点击 - >动作(不能在动作内点击) - >动作完成 - >再次点击.....
这是我想要的〜

How can I disable the touch detection within the action that running, because I don't want the character flying in the sky like a superman if the player clicking and clicking within the action, the character will never land if they keep clicking. I found the method "isDone", is that relate to this method?? player click -> action(cannot click within the action) -> action finish -> click again..... that's what i want~

推荐答案

在视图中停用用户互动,直到操作完成,然后重新启用。

Disable user interactions in your view till the action completes and then enable it again.

>

To disable touch

[self.view setUserInteractionEnabled:NO];

启用触摸

[self.view setUserInteractionEnabled:YES];

请尝试更简洁一些你想要的下一次。

Please try and be a bit more concise of what you want the next time.

这篇关于如何禁用触摸检测?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆