Files
AppleHillsProduction/Assets/Scripts/Minigames/FortFight/Data/ProjectileData.cs
Michal Pikulski f69db57bd7 Stash work
2025-12-02 23:56:13 +01:00

51 lines
1.7 KiB
C#

using UnityEngine;
namespace Minigames.FortFight.Data
{
/// <summary>
/// ScriptableObject defining a projectile type for the ammunition system.
/// Only stores prefab reference and UI data - stats come from the prefab's ProjectileBase component.
/// </summary>
[CreateAssetMenu(fileName = "ProjectileData", menuName = "AppleHills/Fort Fight/Projectile Data", order = 1)]
public class ProjectileData : ScriptableObject
{
[Header("Prefab")]
[Tooltip("Prefab for this projectile (should have ProjectileBase component)")]
public GameObject prefab;
[Header("Ammunition System")]
[Tooltip("Cooldown time in seconds after use")]
public float cooldownTime = 5f;
[Header("UI")]
[Tooltip("Icon sprite for ammunition UI")]
public Sprite icon;
[Tooltip("Display name for this projectile type")]
public string displayName;
[Tooltip("Description of projectile behavior (for tutorial/UI)")]
[TextArea(2, 4)]
public string description;
/// <summary>
/// Get the ProjectileBase component from the prefab (for reading stats)
/// </summary>
public Projectiles.ProjectileBase GetProjectileComponent()
{
if (prefab == null) return null;
return prefab.GetComponent<Projectiles.ProjectileBase>();
}
/// <summary>
/// Get damage value from prefab
/// </summary>
public float GetDamage()
{
var component = GetProjectileComponent();
return component != null ? component.Damage : 0f;
}
}
}