Stash work
This commit is contained in:
50
Assets/Scripts/Minigames/FortFight/Data/ProjectileData.cs
Normal file
50
Assets/Scripts/Minigames/FortFight/Data/ProjectileData.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user