mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
b8bba34d83
移除武器展示界面中不必要的可见性控制代码,统一通过脚本管理可见性 简化场景文件中的冗余属性设置,保持与脚本逻辑一致
29 lines
739 B
GDScript
29 lines
739 B
GDScript
@tool
|
|
extends HBoxContainer
|
|
class_name WeaponShow
|
|
|
|
enum Operation {
|
|
GET,
|
|
EXTRACT,
|
|
}
|
|
|
|
@export var weapon: PackedScene = null
|
|
@export var operation: Operation = Operation.GET
|
|
|
|
@onready var operationLabel: Label = $"%operation"
|
|
@onready var avatarRect: TextureRect = $"%avatar"
|
|
@onready var nameLabel: Label = $"%name"
|
|
@onready var soulShow: ItemShow = $"%soul"
|
|
|
|
func _ready():
|
|
var weaponInstance = weapon.instantiate() as Weapon
|
|
avatarRect.texture = weaponInstance.avatarTexture
|
|
nameLabel.text = weaponInstance.displayName
|
|
soulShow.count = weaponInstance.soulLevel
|
|
if operation == Operation.GET:
|
|
operationLabel.text = "获得武器"
|
|
soulShow.visible = false
|
|
else:
|
|
operationLabel.text = "提炼灵魂"
|
|
soulShow.visible = true
|