Files
zeling_v2/Assets/_Game/Scripts/Skills/FormSkillSO.cs
2026-05-25 11:54:37 +08:00

96 lines
3.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Collections.Generic;
using UnityEngine;
using Animancer;
using BaseGames.Combat;
using BaseGames.Localization;
namespace BaseGames.Skills
{
/// <summary>
/// 技能资源消耗类型。
/// </summary>
public enum SkillResourceType { SoulPower, SpiritPower }
/// <summary>
/// 技能效果类型(决定施放时执行的逻辑分支)。
/// </summary>
public enum SkillEffectType
{
MeleeAoE,
Projectile,
BarrierAura,
GroundDive,
DragonKick,
WraithDash,
ShadowDecoy,
DelayedExplosion
}
/// <summary>
/// 反馈预设 SOFeedbackPresetSO封装一组 MMF_Player 反馈配置。
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/Skills/FeedbackPreset")]
public class FeedbackPresetSO : ScriptableObject { }
/// <summary>
/// 形态技能数据 SO架构 09_ProgressionModule §8
/// 路径: Assets/Scripts/Skills/FormSkillSO.cs
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/Skills/FormSkill")]
public class FormSkillSO : ScriptableObject, ILocalizableAsset
{
[Header("Identity")]
public string skillId;
public string displayNameKey;
[TextArea(1, 3)]
public string descriptionKey;
public Sprite icon;
[Header("Resource")]
public SkillResourceType resourceType;
public int baseCost;
public float cooldown;
[Header("Animation")]
public ClipTransition castAnimation;
public float castLockDuration; // 施放锁定时长(秒)
[Header("Effect")]
public SkillEffectType effectType;
public DamageSourceSO damageSource;
[Header("Projectile")]
public ProjectileConfigSO projectileConfig;
public bool isHoming;
public bool holdForContinuous;
[Header("Dash")]
public float dashForce;
public float dashDuration;
public bool isInvincibleDuringDash;
[Header("Explosion")]
public float explosionDelay;
public float explosionRadius;
[Header("Feedback")]
public FeedbackPresetSO castFeedback;
[Header("HitBox Prefab")]
/// <summary>
/// 近战/爆炸技能的命中盒 Prefab内含 SkillHitBoxInstance + HitBox。
/// 投射物技能此字段留空——由 ProjectileConfigSO 负责。
/// 命名规范: Assets/Prefabs/Skills/SKL_{skillId}_HitBox.prefab
/// </summary>
public GameObject SkillHitBoxPrefab;
public IEnumerable<LocalizationKeyRef> GetLocalizationKeys()
{
if (!string.IsNullOrEmpty(displayNameKey))
yield return new LocalizationKeyRef(displayNameKey, "Skills", nameof(displayNameKey));
if (!string.IsNullOrEmpty(descriptionKey))
yield return new LocalizationKeyRef(descriptionKey, "Skills", nameof(descriptionKey));
}
}
}