immersive-home/app/content/system/camera/camera.gd

18 lines
343 B
GDScript3
Raw Normal View History

2024-03-12 13:49:17 +02:00
extends XRCamera3D
var last_room = null
func _physics_process(_delta):
2024-03-17 18:05:45 +02:00
if HomeApi.has_integration():
2024-03-12 13:49:17 +02:00
update_room()
func update_room():
2024-05-22 19:38:28 +03:00
var room = App.house.find_room_at(global_position)
2024-03-12 13:49:17 +02:00
if room != last_room:
if room:
2024-03-17 18:05:45 +02:00
HomeApi.update_room(room.name)
2024-03-12 13:49:17 +02:00
last_room = room
else:
2024-03-17 18:05:45 +02:00
HomeApi.update_room("outside")
2024-03-12 13:49:17 +02:00
last_room = null