按钮函数在Unity中不可避免
我进行了一些编辑,以进行蛇游戏,当玩家到达蛇头或梯子底部时,一个问题弹出。我设法出现了弹出问题,但找不到该功能,甚至无法搜索该功能。
我将按钮代码放在播放器移动后移动后的按钮代码下方蛇或梯子的底部。
我不允许以Unity分离其他按钮代码将按钮代码分开吗?
I made some edit to Snake&Ladder game where a question pop-up when player reach head of snake or bottom of the ladder. I manage to get the pop-up question appear but I can't find the function, not even the able to search the function.
I put the button code under transform position code when the player move after reach head of snake or bottom of the ladder.
Am I not allowed to separate button code from other button code in Unity?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当程序运行到特定步骤时,如何使按钮无效或隐藏。
方法1:
command1.enabled = false按钮命令被禁用。
command1.visible = false按钮命令隐藏。
方法2:
//禁用
this.getComponent()。enabled = false;
//禁用和灰色
this.getComponent()。互动= false;
希望它对您有帮助。
How to make a button invalid or hide when the program runs to a certain step.
method 1:
Command1.Enabled = False button command is disabled.
Command1.Visible = False button command hidden.
Method 2:
//disable
this.GetComponent().enabled= false;
//disable and gray
this.GetComponent().interactable = false;
Hope it helps you.