skill cfg inspector优化

master
chendian 9 months ago
parent e0fad9ceb3
commit 32b5343f1b

@ -1,10 +1,10 @@
extends Resource extends Resource
class_name Cfg class_name Cfg
var res_name: String var _res_name: String
func get_res_name() -> String: func get_res_name() -> String:
if res_name == "": if _res_name == "":
res_name = Util.get_resource_name(self) _res_name = Util.get_resource_name(self)
return res_name return _res_name

@ -3,10 +3,16 @@ extends AnimationSelectCfg
class_name SkillCfg class_name SkillCfg
@export var name: String @export var name: String
@export var sub_character: CharacterCfg
@export var skill_animation: Animation @export var skill_animation: Animation
@export var range: float @export_tool_button("刷新技能动画", "Callable")
@export var free_lock: bool var refresh_animation: Callable = check_animation
@export var ignore_push: bool @export_group("Combo参数")
@export var stance_from: Enum.EStance = Enum.EStance.GroundAny
@export var stance_to: Enum.EStance
@export var break_level: Enum.EBreakLevel = Enum.EBreakLevel.Break
@export var is_charging: bool
@export_group("攻击参数")
@export var attack1: AttackCfg @export var attack1: AttackCfg
@export var attack1_box: AttackBoxCfg @export var attack1_box: AttackBoxCfg
@export var attack1_with_pause_frame: bool @export var attack1_with_pause_frame: bool
@ -15,21 +21,18 @@ class_name SkillCfg
@export var attack2_box: AttackBoxCfg @export var attack2_box: AttackBoxCfg
@export var attack2_with_pause_frame: bool @export var attack2_with_pause_frame: bool
@export var attack2_with_stop: bool @export var attack2_with_stop: bool
@export var sub_character: CharacterCfg @export_group("数值和标记")
@export var stance_from: Enum.EStance = Enum.EStance.GroundAny
@export var stance_to: Enum.EStance
@export var break_level: Enum.EBreakLevel = Enum.EBreakLevel.Break
@export var is_charging: bool
@export var mp_cost: int @export var mp_cost: int
@export var mp_sub_cost: bool @export var mp_sub_cost: bool
@export var warn_type: Enum.ESkillWarnType = Enum.ESkillWarnType.None @export var free_lock: bool
@export var ignore_push: bool
@export var with_stop: bool = false @export var with_stop: bool = false
@export var is_lock_x: bool = true @export var is_lock_x: bool = true
@export var is_lock_x_move: bool = false @export var is_lock_x_move: bool = false
@export_group("辅助参数")
@export var range: float
@export var warn_type: Enum.ESkillWarnType = Enum.ESkillWarnType.None
@export var refresh_animation: bool:
get: return false
set(value): if Engine.is_editor_hint(): check_animation()
var attack_particle: Dictionary = {} var attack_particle: Dictionary = {}
var owner: CharacterCfg var owner: CharacterCfg
@ -39,7 +42,7 @@ func check_animation() -> bool:
var res_name: String = get_res_name() var res_name: String = get_res_name()
var path: String = "res://resource/skill_animation/%s.tres" % res_name var path: String = "res://resource/skill_animation/%s.tres" % res_name
if sprite_frames == null: if sprite_frames == null:
print("未设置技能动画资源") print("未设置技能动画资源:", res_name)
return false return false
if animation_name == "": if animation_name == "":
print("未设置技能动画名") print("未设置技能动画名")

Loading…
Cancel
Save