fix(scenes) 种田系统测试,添加按钮等

This commit is contained in:
wvellichor committed 2026-01-10 05:31:51 +08:00
1 parent ce4e04740a
commit 761a9338ba
19 files changed
+1248 -86

No files matched your search

+13 -3
View File
@@ -223,18 +223,28 @@ export default class InventoryTestScene extends Phaser.Scene {
createButtons() {
const buttonWidth = 200;
const buttonHeight = 40;
const buttonY = this.sys.game.config.height - 100;
const buttonY = this.sys.game.config.height - 150;
// 创建背包按钮
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY, '打开/关闭背包', () => {
this.inventoryUI.toggle();
});
// 创建随机物品按钮
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY, '创建随机物品', () => {
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY + 50, '创建随机物品', () => {
this.itemManager.createRandomItem();
});
// 创建清理物品按钮
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY + 50, '清理所有物品', () => {
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY + 100, '清理所有物品', () => {
this.itemManager.clearAllItems();
this.itemInfoText.setText('所有物品已清理');
});
// 创建返回菜单按钮
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY + 150, '返回菜单', () => {
this.scene.start('BootScene');
});
}
/**