mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
4a66a1754e
清理World场景中未使用的Node节点及其关联脚本,同时简化ItemStore类的继承关系
27 lines
568 B
GDScript
27 lines
568 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.get(type, "baseball"))
|