mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-29 21:31:29 +08:00
fix(scenes) 种田系统测试,添加按钮等
This commit is contained in:
1 parent
ce4e04740a
commit
761a9338ba
19 files changed
+1248
-86
No files matched your search
+5
-7
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user