mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
21 lines
418 B
GDScript
21 lines
418 B
GDScript
@tool
|
|
class_name ItemStore
|
|
|
|
enum ItemType {
|
|
BASEBALL,
|
|
BASKETBALL,
|
|
APPLE
|
|
}
|
|
static var nameMap = {
|
|
ItemType.BASEBALL: "棒球",
|
|
ItemType.BASKETBALL: "篮球",
|
|
ItemType.APPLE: "苹果"
|
|
}
|
|
static var idMap = {
|
|
ItemType.BASEBALL: "baseball",
|
|
ItemType.BASKETBALL: "basketball",
|
|
ItemType.APPLE: "apple"
|
|
}
|
|
static func getTexture(type: ItemType) -> Texture2D:
|
|
return load("res://resources/items/%s.svg" % idMap[type])
|