12 lines
310 B
GDScript3
Raw Normal View History

2024-02-14 12:52:59 +00:00
extends CheckButton
@export var layer_number: int
func _ready():
set_pressed_no_signal(Global.camera.cull_mask & (1 << (layer_number - 1)))
func on_toggled(toggled_on: bool):
if toggled_on:
Global.camera.cull_mask |= 1 << (layer_number - 1)
else:
Global.camera.cull_mask &= ~(1 << (layer_number - 1))