20 lines
633 B
GDScript
20 lines
633 B
GDScript
extends EditorInspectorPlugin
|
|
|
|
|
|
const GlobalSoundSelector = preload("global_sound_selector.gd")
|
|
const GlobalMusicSelector = preload("global_music_selector.gd")
|
|
|
|
|
|
func _can_handle(object: Object) -> bool:
|
|
return true
|
|
|
|
|
|
func _parse_property(object: Object, type: Variant.Type, name: String, hint_type: PropertyHint, hint_string: String, usage_flags: int, wide: bool) -> bool:
|
|
if type == TYPE_STRING_NAME:
|
|
if hint_string == "global_sound":
|
|
add_property_editor(name, GlobalSoundSelector.new())
|
|
return true
|
|
if hint_string == "global_music":
|
|
add_property_editor(name, GlobalMusicSelector.new())
|
|
return true
|
|
return false
|