extends Node

@export var binded_camera: PhantomCamera2D

var _binded_cam: PhantomCamera2D

func _ready() -> void:
	_binded_cam = binded_camera
	if not _binded_cam:
		_binded_cam = get_parent() as PhantomCamera2D
	
	if not _binded_cam:
		printerr("[CameraTool]: No Vaild Camera Founded")

## 将自己的priority设置为最高
func hold_self_priority() -> void:
	var pcs = PhantomCameraManager.get_phantom_camera_2ds()
	for pc in pcs:
		pc.priority = -1
	
	_binded_cam.priority = 100

## 将自己的priority设置为不可用
func release_self_priority() -> void:
	_binded_cam.priority = -1
