serialize some fields

This commit is contained in:
Ian Woods 2026-07-14 22:04:08 -07:00
parent ef5063c8a5
commit fb945db872
3 changed files with 19 additions and 5 deletions

View file

@ -12,13 +12,13 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 22b36bfcd0ae4af4098d908138e874e1, type: 3}
m_Name: FireballSpell
m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.BuilderSpells.FireballSpellDefinition
DisplayName:
Description:
DisplayName: Fireball
Description: Shoot a fireball
Icon: {fileID: 0}
Cooldown: 5
TargetType: 0
Radius: 3
enemyLayerMask:
serializedVersion: 2
m_Bits: 128
m_Bits: 1024
Damage: 50

View file

@ -20,6 +20,6 @@ MonoBehaviour:
Radius: 5
enemyLayerMask:
serializedVersion: 2
m_Bits: 128
m_Bits: 1024
SlowFactor: 0.5
EffectDuration: 3

View file

@ -10,7 +10,7 @@ namespace TD.Gameplay.BuilderSpells
/// </summary>
/// <remarks>
/// <see cref="BuilderSpellDefinition.TargetType"/> is <see cref="SpellTargetType.PointTarget"/>
/// — the cast controller shows only a fixed-size reticle, even though
/// — the cast controller shows only a fixed-size reticule, even though
/// <see cref="BuilderSpellDefinition.Radius"/> is still used internally here as the splash
/// radius (0 = no splash, direct hit only).
/// </remarks>
@ -19,6 +19,14 @@ namespace TD.Gameplay.BuilderSpells
{
public override BuilderSpellKind Kind => BuilderSpellKind.Fireball;
[Header("Impact VFX")]
[Tooltip("Prefab spawned at the target point on a successful cast. Optional — leave empty for no visual.")]
[SerializeField] private GameObject impactVfxPrefab;
[Tooltip("Seconds before the spawned VFX instance is destroyed.")]
[Min(0f)]
[SerializeField] private float impactVfxLifetime = 2f;
[Header("Fireball")]
[Tooltip("Damage dealt to every enemy within Radius of the target point.")]
[Min(0f)]
@ -43,5 +51,11 @@ namespace TD.Gameplay.BuilderSpells
return hitAny;
}
public override void ClientPlayVfx(Vector3 targetPoint)
{
if (impactVfxPrefab != null)
Destroy(Instantiate(impactVfxPrefab, targetPoint, Quaternion.identity), impactVfxLifetime);
}
}
}