游戏开发:库存管理与对话树实现
库存管理
在游戏中,库存系统的管理至关重要。当玩家在库存中选择物品时,通常希望被选中的物品成为新的光标,而旧光标放回库存。但当玩家用错误的光标选择库存中的物品时,需要特殊处理。
错误选择处理
- 修改 ObjectLookUp 脚本
- 打开 ObjectLookUp 脚本。
- 在 LookUpState 函数底部,修改 HandleNoMatchReplies(picker) 行:
// if the picked object is not an inventory object, build a no match reply for it
if (gameObject.tag != "InventoryObject" && !match) HandleNoMatchReplies(picker);
- 在 LookUpState 函数结束的大括号前添加:
// if the cursor was not a match and the picked object has the Inventory tag
else if (matchCursor != "default" && !match){ //swap out the cursor with the object it picked
//put the old c
超级会员免费看
订阅专栏 解锁全文
12

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



