Spatial 2D sound w/ reverb, first attempt
This commit is contained in:
parent
7833a1c756
commit
3ec5a9edf7
17 changed files with 192 additions and 13 deletions
25
core/polygon/polygon.gd
Normal file
25
core/polygon/polygon.gd
Normal file
|
@ -0,0 +1,25 @@
|
|||
@tool
|
||||
extends CollisionPolygon2D
|
||||
|
||||
@export var color: Color = Color.WHITE:
|
||||
set(v):
|
||||
color = v
|
||||
update_polygon()
|
||||
get():
|
||||
return color
|
||||
|
||||
@export var update: bool:
|
||||
set(v):
|
||||
update_polygon()
|
||||
|
||||
func update_polygon():
|
||||
# normal polygon
|
||||
$Polygon2D.polygon = polygon
|
||||
$Polygon2D.color = color
|
||||
# light occluder
|
||||
var lo_polygon = OccluderPolygon2D.new()
|
||||
lo_polygon.polygon = polygon
|
||||
$LightOccluder2D.occluder = lo_polygon
|
||||
|
||||
func _ready() -> void:
|
||||
update_polygon()
|
Reference in a new issue