2015-05-29 96 views
0

當我從視圖控制器添加UIImageview時,我想使touchesbegan方法處於非活動狀態,直到按下uiimage。Touchesbegan方法從視圖控制器處於非活動狀態

現在我已經設置了一切,我只需要知道如何通過在viewcontroller中設置代碼(僅)來防止gamescene注意到觸摸。

任何人都知道如何?

GameScene.paused = true // this pauses the game, but the touchesbegan method is still active! 

回答

0

您可以設置userInteractionEnabled對視圖假要禁用觸摸或者你可以做的觸摸開始時檢查的起因是這樣:

if GameScene.paused == true { 
    return 
} 
相關問題