refactor: unify interactable components

This commit is contained in:
ANG-Server
2026-07-21 23:23:26 +08:00
parent 9dee47492c
commit 74a0fb8309
17 changed files with 241 additions and 208 deletions

View File

@@ -1,14 +0,0 @@
class_name InteractionAnchor
extends RefCounted
# 所有交互距离与地图标记共用的世界锚点。
# Area2D 优先使用实际 CollisionShape2D 的中心,避免脚本节点原点与碰撞区域有偏移时
# 出现“能交互的位置”和白圈不一致的问题。
static func get_position(node: Node2D) -> Vector2:
var area: Area2D = node as Area2D
if area != null:
for child: Node in area.get_children():
var collision_shape: CollisionShape2D = child as CollisionShape2D
if collision_shape != null and not collision_shape.disabled and collision_shape.shape != null:
return collision_shape.global_position
return node.global_position

View File

@@ -1 +0,0 @@
uid://dogltsticcpy2