多轮审查和修复
This commit is contained in:
77
Assets/Scripts/Spells/SpellSO.cs
Normal file
77
Assets/Scripts/Spells/SpellSO.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using UnityEngine;
|
||||
using Animancer;
|
||||
using BaseGames.Combat;
|
||||
using BaseGames.Skills; // FeedbackPresetSO
|
||||
|
||||
namespace BaseGames.Spells
|
||||
{
|
||||
/// <summary>
|
||||
/// 法术消耗的资源类型。
|
||||
/// </summary>
|
||||
public enum SpellResourceType { SoulPower, SpiritPower }
|
||||
|
||||
/// <summary>
|
||||
/// 法术效果分类(决定施放时的逻辑分支)。
|
||||
/// </summary>
|
||||
public enum SpellEffectType
|
||||
{
|
||||
Projectile, // 投射物法术
|
||||
AreaOfEffect, // 范围爆炸
|
||||
SelfBuff, // 自身增益(护盾/加速/再生)
|
||||
SummonShade, // 召唤投影
|
||||
TeleportBlink, // 瞬移
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 法术数据 SO(架构 BaseGames.Spells)。
|
||||
/// 创建路径:Assets/Data/Spells/SPL_{spellId}.asset
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Spells/Spell")]
|
||||
public class SpellSO : ScriptableObject
|
||||
{
|
||||
[Header("Identity")]
|
||||
[Tooltip("全局唯一 ID,建议使用 GameIds 域中的常量")]
|
||||
public string spellId;
|
||||
[Tooltip("本地化 Key(从 LocalizationManager.Get(displayNameKey, \"Spells\") 获取)")]
|
||||
public string displayNameKey;
|
||||
[TextArea(1, 3)]
|
||||
public string descriptionKey;
|
||||
public Sprite icon;
|
||||
|
||||
[Header("Resource")]
|
||||
public SpellResourceType resourceType;
|
||||
[Min(1)]
|
||||
public int baseCost;
|
||||
[Min(0f)]
|
||||
public float cooldown;
|
||||
|
||||
[Header("Effect")]
|
||||
public SpellEffectType effectType;
|
||||
public DamageSourceSO damageSource;
|
||||
|
||||
[Header("Projectile")]
|
||||
public ProjectileConfigSO projectileConfig;
|
||||
[Tooltip("是否追踪最近敌人")]
|
||||
public bool isHoming;
|
||||
|
||||
[Header("AoE")]
|
||||
[Min(0f)] public float explosionRadius;
|
||||
[Min(0f)] public float explosionDelay;
|
||||
|
||||
[Header("Buff")]
|
||||
[Min(0f)] public float buffDuration;
|
||||
[Min(0f)] public float buffValue; // 含义由 effectType 决定(如护盾量、速度倍率)
|
||||
|
||||
[Header("Animation")]
|
||||
public ClipTransition castAnimation;
|
||||
[Min(0f)]
|
||||
public float castLockDuration; // 施放锁定时长(秒)
|
||||
|
||||
[Header("HitBox Prefab")]
|
||||
[Tooltip("近战/爆炸类法术的命中盒 Prefab(投射物法术留空)")]
|
||||
public GameObject spellHitBoxPrefab;
|
||||
|
||||
[Header("Feedback")]
|
||||
public FeedbackPresetSO castFeedback;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user