【发布时间】:2018-11-26 23:59:54
【问题描述】:
我有游戏对象,它是按钮(称为图块),当单击按钮时,它将处于非活动状态,并且有一个条件要测试,如果条件为真,则按钮将被销毁,但如果为假,则按钮将返回到它的活动状态。
我的游戏管理器脚本(条件):
public void checkword()
{
wordBuilded = displayer.text.ToString();
if (txtContents.Contains(wordBuilded))
{
Debug.Log(wordBuilded + " Is on the list");
wordScore++;
Debug.Log(wordScore);
}
else
{
Debug.Log("Someting is wrong..");
FindObjectOfType<LetterTiles>().tileStatus();
}
}
在我的按钮(平铺)脚本上(附加到按钮的脚本):
public void letterClick()
{
gameManager.currentWord += letter;
gameObject.SetActive(false);
}
public void tileStatus()
{
gameObject.SetActive(true);
}
【问题讨论】:
-
你没有提到问题是什么
-
我希望按钮对象在条件为假时重新出现
标签: c# visual-studio unity3d button