20 lines
563 B
GDScript
20 lines
563 B
GDScript
extends Area2D
|
|
class_name DatawhaleHonorBoard
|
|
|
|
const RANKING_PANEL_SCENE: PackedScene = preload("res://scenes/ui/datawhale_honor_ranking_panel.tscn")
|
|
const RANKING_PANEL_NAME: String = "DatawhaleHonorRankingPanel"
|
|
const INTERACTION_COLLISION_LAYER: int = 2
|
|
|
|
func _ready() -> void:
|
|
collision_layer = INTERACTION_COLLISION_LAYER
|
|
collision_mask = 0
|
|
|
|
func interact() -> void:
|
|
var root: Window = get_tree().root
|
|
if root.has_node(RANKING_PANEL_NAME):
|
|
return
|
|
|
|
var panel := RANKING_PANEL_SCENE.instantiate()
|
|
panel.name = RANKING_PANEL_NAME
|
|
root.add_child(panel)
|