mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 00:31:29 +08:00
feat(inventory) 添加背包物品移动、拾取到背包、丢弃背包物品功能
This commit is contained in:
1 parent
ae26209a24
commit
35e10a2abc
6 files changed
+408
-115
No files matched your search
@@ -278,6 +278,27 @@ export class ItemManager {
|
||||
return this.itemTemplates.get(itemId) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前场景中的所有活动物品
|
||||
* @returns {Array} - 活动物品数组
|
||||
*/
|
||||
getActiveItems() {
|
||||
return Array.from(this.activeItems);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理所有物品
|
||||
*/
|
||||
clearAllItems() {
|
||||
// 销毁所有活动物品
|
||||
this.activeItems.forEach(item => {
|
||||
item.destroy();
|
||||
});
|
||||
|
||||
// 清空活动物品集合
|
||||
this.activeItems.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有物品模板
|
||||
* @returns {Map} - 所有物品模板的Map对象
|
||||
|
||||
Reference in new issue
Block a user