mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
a29be1e431
- 新增CameraManager脚本用于相机管理 - 在UI场景中添加物品收集容器VBoxContainer - 扩展ItemShow类支持生成物品显示实例 - 修改EntityBase添加物品收集信号和处理逻辑 - 调整BossBar位置和布局属性
20 lines
557 B
GDScript
20 lines
557 B
GDScript
@tool
|
|
extends HBoxContainer
|
|
class_name ItemShow
|
|
|
|
@export var type: ItemStore.ItemType = ItemStore.ItemType.BASEBALL
|
|
@export var count: int = 0
|
|
|
|
@onready var avatarTexture: TextureRect = $"%avatar"
|
|
@onready var countLabel: Label = $"%count"
|
|
|
|
func _physics_process(_delta):
|
|
avatarTexture.texture = ItemStore.getTexture(type)
|
|
countLabel.text = str(count)
|
|
|
|
static func generate(itemType: ItemStore.ItemType, itemCount: int = 1):
|
|
var item = preload("res://components/UI/ItemShow.tscn").instantiate()
|
|
item.type = itemType
|
|
item.count = itemCount
|
|
return item
|