游戏开发:消息文本与库存系统优化
1. 跟踪光标移动
在游戏中,显示动作消息的时间设置很关键。对于简短的动作消息,现有的时间设置可能合理,但对于较长的消息或母语不同的玩家来说,可能就显得仓促了。在设计交互性时,很容易陷入响应时间过短的陷阱。为了解决这个问题,可以让玩家通过移动光标来关闭消息。
1.1 实现步骤
- 打开
GameManager脚本。 - 在
// Pick and mouseover info部分添加变量:
internal var watchForInput : boolean = false; // flag to watch for mouse movement after action message
internal var lastMousePos : Vector3; // last mouse position
- 在
Update函数中添加监控光标位置的代码:
if (watchForInput) { // if the flag is on,
if (Input.mousePosition.x != lastMousePos.x) { // if the curso
超级会员免费看
订阅专栏 解锁全文
9万+

被折叠的 条评论
为什么被折叠?



