mirror of
https://github.com/SEISYUNLie/Platform-Jump.git
synced 2026-10-24 01:41:10 +08:00
20 lines
494 B
GDScript
20 lines
494 B
GDScript
extends Area2D
|
|
|
|
var button = null
|
|
var camera = null
|
|
|
|
func _ready():
|
|
camera = get_tree().get_first_node_in_group("camera")
|
|
button = get_tree().get_first_node_in_group("button")
|
|
body_entered.connect(update_camera)
|
|
|
|
func update_camera(body):
|
|
print("有物体进入摄像机区域:", body.name)
|
|
if not body.is_in_group("player"):
|
|
return
|
|
print("玩家进入,开始改摄像头限制")
|
|
camera.limit_left = 555
|
|
camera.limit_right = 1010
|
|
camera.limit_top = 0
|
|
camera.limit_bottom = 270
|