0
for (int i=0; i<=83; i++)
{
GameObject btns = Instantiate (buttoneg.gameObject) as GameObject;
btns.gameObject.GetComponent<LevelButton>().levelNo = i + 1;
if(btns.gameObject.GetComponent<LevelButton>().levelNo<maxlvlreached)
{
btns.gameObject.GetComponent<LevelButton>().button.image.color=Color.green;
}
}
下面的語句是我的代碼,我想要做的就是繼續檢查,如果整個循環語句,但由於某些原因,它不,幫助將不勝感激。 謝謝!如果使用內for循環
你得到了什麼樣的錯誤? Isnt'maxlvlreached'類型bool? –
你檢查過'maxlvlreached'的值了嗎? – AntiHeadshot
不,maxlvlreached是整數,我從playerpref獲取它,我沒有得到任何錯誤,它只是不工作 –