2017-04-25 86 views

回答

0

逻辑在你身上,但我认为这将是一个很好的分配布尔值。

如果级别完成,则将其设置为true,否则将其设置为false。

如果需要,可以为每个级别创建一组布尔值。

就在这个基本的代码 - >

if (isUnlocked/* True Anyway, So no need to add == true */){ 
    button.setEnabled(true); 

    //Whatever you want to do when User Completes the Level like Changing the image, I Have kept that when it is unlocked, That time we can press it. 
} else { 
    button.setEnabled(false); 

    //Whatever you want to do when User Has not completed the Level 
} 

再次,这取决于你的逻辑

那么好运!