2025-08-26 18:09:04 +08:00
|
|
|
@tool
|
|
|
|
|
class_name ItemStore
|
|
|
|
|
|
|
|
|
|
enum ItemType {
|
|
|
|
|
BASEBALL,
|
2025-08-27 10:23:57 +08:00
|
|
|
BASKETBALL,
|
|
|
|
|
APPLE
|
2025-08-26 18:09:04 +08:00
|
|
|
}
|
|
|
|
|
static var nameMap = {
|
|
|
|
|
ItemType.BASEBALL: "棒球",
|
2025-08-27 10:23:57 +08:00
|
|
|
ItemType.BASKETBALL: "篮球",
|
|
|
|
|
ItemType.APPLE: "苹果"
|
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",
|
|
|
|
|
ItemType.APPLE: "apple"
|
2025-08-26 20:46:02 +08:00
|
|
|
}
|
|
|
|
|
static func getTexture(type: ItemType) -> Texture2D:
|
2025-08-27 10:23:57 +08:00
|
|
|
return load("res://resources/items/%s.svg" % idMap[type])
|