Add scenes, static scene-finding mechanism, and scene pool for visual hold/tap notes.
This commit is contained in:
26
rhythm_game/note/visual/note_scenes.gd
Normal file
26
rhythm_game/note/visual/note_scenes.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
## Static class that stores references to note scenes.
|
||||
class_name NoteScenes extends Object
|
||||
|
||||
static func get_tap(skin: StringName = "default") -> PackedScene:
|
||||
if _tap_scenes.has(skin):
|
||||
return _tap_scenes[skin]
|
||||
else:
|
||||
push_warning("Tap note skin [", skin, "] does not exist.")
|
||||
return _tap_scenes["default"]
|
||||
|
||||
static func get_hold(skin: StringName = "default") -> PackedScene:
|
||||
if _hold_scenes.has(skin):
|
||||
return _hold_scenes[skin]
|
||||
else:
|
||||
push_warning("Hold note skin [", skin, "] does not exist.")
|
||||
return _hold_scenes["default"]
|
||||
|
||||
# ======== IMPLEMENTATION ======== #
|
||||
|
||||
static var _tap_scenes: Dictionary[StringName, PackedScene] = {
|
||||
"default": load("uid://dq5ocf0272tet")
|
||||
}
|
||||
|
||||
static var _hold_scenes: Dictionary[StringName, PackedScene] = {
|
||||
"default": load("uid://jbgxbhfpj806")
|
||||
}
|
||||
Reference in New Issue
Block a user