20 lines
398 B
GDScript
20 lines
398 B
GDScript
extends NinePatchRect
|
|
|
|
class_name BuyMenuButton
|
|
|
|
@export var Price : float
|
|
@export var Clickable : BaseButton
|
|
|
|
@onready var BuyMenuObj = $".."
|
|
@onready var PlayerShip = get_tree().current_scene.get_node("MainShip")
|
|
|
|
func _ready():
|
|
Clickable.button_up.connect(_button_up)
|
|
|
|
func _button_up():
|
|
if PlayerShip.Money >= Price:
|
|
PlayerShip.Money -= Price
|
|
bought_action()
|
|
|
|
func bought_action():
|
|
pass
|