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

18 lines
344 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():
var room = House.body.find_room_at(global_position)
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