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

+5 -7
View File
@@ -126,13 +126,11 @@ export default class Crop extends Phaser.GameObjects.Sprite {
* 作物被点击时的处理函数
*/
onCropClicked() {
if (this.isHarvestable) {
this.harvest();
} else {
// 显示生长进度
const growthProgress = Math.min(100, Math.floor(((Date.now() - this.plantedTime) / this.growthTime) * 100));
this.scene.events.emit('show-message', `作物正在生长中: ${growthProgress}%`);
}
// 调用场景的显示作物详情方法
this.scene.showCropDetails(this);
// 阻止事件冒泡,防止触发角色移动
return false;
}
/**