简体   繁体   English

Unity 5 NGUI突出显示的Sprite Button脚本问题

[英]Unity 5 NGUI Highlighted Sprite Button Script Issue

I'm currently using Unity 5 GUI system and having one issue with the Highlighted Sprite Button Script. 我当前正在使用Unity 5 GUI系统,并且突出显示的Sprite Button脚本有一个问题。 Under the Button Script / Sprite Swap / Highlighted Sprite, I can keep the highlighted sprite to stay highlighted, but once I clicked outside the button, it goes back to normal or the highlighted state goes away. 在“按钮脚本” /“子画面交换” /“突出显示的子画面”下,我可以保持突出显示的子画面保持突出显示,但是一旦在按钮外部单击,它就会恢复正常或突出显示状态消失。

I wanted to the highlighted button to stay on so that the end user know which scene they are in. 我希望高亮显示的按钮保持打开状态,以便最终用户知道他们所处的场景。

How can I keep the highlighted state on until I press another button? 在按下另一个按钮之前,如何保持突出显示状态?

您可能要使用切换按钮而不是按钮。

You can just use disabled sprite instead of highlighted sprite and disable and enable each button as per you requirements. 您可以只使用禁用的精灵而不是突出显示的精灵,并根据需要禁用和启用每个按钮。

Disable the button according to your scene, you can keep it disabled unless you press any other button. 根据您的场景禁用该按钮,除非您按其他任何按钮,否则可以将其保持禁用状态。 After your scene change just enable the old button and disable new pressed button. 更改场景后,只需启用旧按钮并禁用新按下的按钮即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM