Initial WhaleTown V2 frontend

This commit is contained in:
2026-07-19 22:42:20 +08:00
commit 435c578dde
1421 changed files with 54486 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
class_name WorkZoneBuildingArea
extends Area2D
# ============================================================================
# WorkZoneBuildingArea.gd - 打工区建筑交互入口
# ============================================================================
# 为打工区建筑提供统一交互数据,玩家面对入口按交互键时由 PlayerController 调用。
# ============================================================================
const INTERACTION_COLLISION_LAYER: int = 2
@export var buildingId: String = ""
@export var buildingTitle: String = ""
@export var buildingRole: String = ""
func _ready() -> void:
collision_layer = INTERACTION_COLLISION_LAYER
collision_mask = 0
func interact() -> void:
var payload := {
"buildingId": buildingId,
"title": buildingTitle,
"role": buildingRole,
"nodePath": get_path(),
}
var eventSystem := get_node_or_null("/root/EventSystem")
if eventSystem != null:
eventSystem.call("emit_event", EventNames.OBJECT_INTERACTED, payload)
print("WorkZone building interacted: %s - %s" % [buildingTitle, buildingRole])