【发布时间】:2016-05-25 19:30:30
【问题描述】:
我最近考虑在我的游戏中添加一个 InGame 按钮。它不是 GUI 或 UI 按钮,而是块,例如添加到墙。
虚拟代码:
OnTriggerEnter(c:Collider) {
if(c.gameObject.tag =="Player")
{
//Text = "E to interact!"
if(key.pressed("e")
{
//Connect the Button to a specific Block, play a Animation
}
}
}
那么如何将特定块连接到按钮,如果我按 e,仅在特定块上播放动画?请记住,我是 Unity 的新手。 感谢您的帮助!
【问题讨论】:
-
能否详细说明一下!