2025-08-26 18:09:04 +08:00
|
|
|
@tool
|
|
|
|
|
class_name ItemStore
|
|
|
|
|
|
|
|
|
|
enum ItemType {
|
|
|
|
|
BASEBALL,
|
2025-08-27 10:23:57 +08:00
|
|
|
BASKETBALL,
|
2025-09-06 11:05:56 +08:00
|
|
|
APPLE,
|
2025-09-19 22:38:25 +08:00
|
|
|
BEACHBALL,
|
|
|
|
|
SOUL,
|
2025-08-26 18:09:04 +08:00
|
|
|
}
|
|
|
|
|
static var nameMap = {
|
|
|
|
|
ItemType.BASEBALL: "棒球",
|
2025-08-27 10:23:57 +08:00
|
|
|
ItemType.BASKETBALL: "篮球",
|
2025-09-06 11:05:56 +08:00
|
|
|
ItemType.APPLE: "苹果",
|
2025-09-19 22:38:25 +08:00
|
|
|
ItemType.BEACHBALL: "沙滩球",
|
|
|
|
|
ItemType.SOUL: "灵魂",
|
2025-08-26 18:09:04 +08:00
|
|
|
}
|
|
|
|
|
static var idMap = {
|
|
|
|
|
ItemType.BASEBALL: "baseball",
|
2025-08-27 10:23:57 +08:00
|
|
|
ItemType.BASKETBALL: "basketball",
|
2025-09-06 11:05:56 +08:00
|
|
|
ItemType.APPLE: "apple",
|
2025-09-19 22:38:25 +08:00
|
|
|
ItemType.BEACHBALL: "beachball",
|
|
|
|
|
ItemType.SOUL: "soul",
|
2025-08-26 20:46:02 +08:00
|
|
|
}
|
|
|
|
|
static func getTexture(type: ItemType) -> Texture2D:
|
2025-09-21 13:56:50 +08:00
|
|
|
return ComponentManager.getItemTexture(idMap.get(type, "baseball"))
|