Files
ai-game-2/ResourcePolygon2D.gd

18 lines
337 B
GDScript

@tool
extends Polygon2D
class_name ResourcePolygon2D
@export var points_resource: PolygonPointsResource:
set(value):
points_resource = value
_update_polygon()
func _update_polygon() -> void:
if points_resource and points_resource.points.size() > 0:
polygon = points_resource.points
func _ready() -> void:
_update_polygon()