|
|
|
|
@ -18,6 +18,35 @@ extends Node3D
|
|
|
|
|
process_dir("res://")
|
|
|
|
|
print("done.")
|
|
|
|
|
|
|
|
|
|
var selected_skill_file: String
|
|
|
|
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
|
|
|
if not Engine.is_editor_hint():
|
|
|
|
|
return
|
|
|
|
|
var selected_paths = EditorInterface.get_selected_paths()
|
|
|
|
|
if len(selected_paths) != 1:
|
|
|
|
|
return
|
|
|
|
|
var selected_path = selected_paths[0]
|
|
|
|
|
if selected_skill_file == selected_path:
|
|
|
|
|
return
|
|
|
|
|
selected_skill_file = selected_path
|
|
|
|
|
if not selected_path.ends_with(".tres"):
|
|
|
|
|
return
|
|
|
|
|
var res := ResourceLoader.load(selected_path)
|
|
|
|
|
if not res is SkillCfg:
|
|
|
|
|
return
|
|
|
|
|
var skill_cfg = res as SkillCfg
|
|
|
|
|
|
|
|
|
|
if not skill_cfg.skill_animation:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
var character_skill = $Character/Skill as AnimationPlayer
|
|
|
|
|
EditorInterface.edit_node(character_skill)
|
|
|
|
|
var animation_name: String = "animation_library/%s" % Util.get_resource_name(res)
|
|
|
|
|
character_skill.current_animation = animation_name
|
|
|
|
|
print(selected_path)
|
|
|
|
|
EditorInterface.edit_resource(res)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func process_mesh_lib(dir_name: String) -> void:
|
|
|
|
|
var dir := DirAccess.open(dir_name)
|
|
|
|
|
|