Cow_Life_Sim_RPG/MiniGames/RingToss/TargetAreaVisual.gd

34 lines
772 B
GDScript

@tool
extends Polygon2D
@export var Enable:bool
@export var Clear:bool
# Called when the node enters the scene tree for the first time.
func _ready():
if(!Engine.is_editor_hint()): queue_free()
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Enable:
var WidthBottom:float = 280
var WidthTop:float = 170
var max_height:float = -220
var min_height:float = 135
var pack = PackedVector2Array()
pack.append(Vector2(WidthBottom, min_height))
pack.append(Vector2(-WidthBottom, min_height))
pack.append(Vector2(-WidthTop, max_height ))
pack.append(Vector2(WidthTop, max_height ))
polygon = pack
Enable = false
if Clear:
polygon.clear()
pass