mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
d54c050be9
将分散在各处的资源加载逻辑统一到ComponentManager中管理 添加对UI组件、主题、物品纹理和饲料的集中管理 移除SkillIconBase.tscn并迁移到UI目录
27 lines
552 B
GDScript
27 lines
552 B
GDScript
@tool
|
|
class_name ItemStore
|
|
|
|
enum ItemType {
|
|
BASEBALL,
|
|
BASKETBALL,
|
|
APPLE,
|
|
BEACHBALL,
|
|
SOUL,
|
|
}
|
|
static var nameMap = {
|
|
ItemType.BASEBALL: "棒球",
|
|
ItemType.BASKETBALL: "篮球",
|
|
ItemType.APPLE: "苹果",
|
|
ItemType.BEACHBALL: "沙滩球",
|
|
ItemType.SOUL: "灵魂",
|
|
}
|
|
static var idMap = {
|
|
ItemType.BASEBALL: "baseball",
|
|
ItemType.BASKETBALL: "basketball",
|
|
ItemType.APPLE: "apple",
|
|
ItemType.BEACHBALL: "beachball",
|
|
ItemType.SOUL: "soul",
|
|
}
|
|
static func getTexture(type: ItemType) -> Texture2D:
|
|
return ComponentManager.getItemTexture(idMap[type])
|