in-world ui textboxes
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
class_name EntityProximityArea extends Area3D
|
||||
|
||||
@export var entity:Entity
|
||||
|
||||
var _triggered:bool = false
|
||||
|
||||
func _ready() -> void:
|
||||
body_entered.connect(_onBodyEntered)
|
||||
|
||||
func _onBodyEntered(body:Node3D) -> void:
|
||||
if _triggered:
|
||||
return
|
||||
if !(body is Entity):
|
||||
return
|
||||
if (body as Entity).entityId != "player":
|
||||
return
|
||||
_triggered = true
|
||||
assert(entity != null && entity.chatboxMessage != "")
|
||||
var chatbox:WorldChatBox = UI.spawnWorldChatBox(entity)
|
||||
chatbox.showTimed(entity.chatboxMessage, entity.chatboxDuration)
|
||||
Reference in New Issue
Block a user