// Assets/_Project/Scripts/Towers/ConstructionPhaseSet.cs
using UnityEngine;
namespace TD.Towers
{
///
/// An ordered set of construction-stage visuals a build site transitions between as a
/// tower is built — typically 3 assets (early → mid → late). A tower references its own
/// set via ; build sites fall back to a
/// project-default set when a tower doesn't define one.
///
///
/// The entries are shape prefabs only. BuildSiteVisual applies the
/// queued (green) / constructing / paused materials and the owner tint on top, so the
/// phase assets don't need their own build-state materials. Keep them simple
/// (single material) — the build site swaps the active phase's renderer material.
///
[CreateAssetMenu(fileName = "ConstructionPhaseSet", menuName = "TD/Construction Phase Set")]
public class ConstructionPhaseSet : ScriptableObject
{
[Tooltip("Ordered construction-stage prefabs. Shown in sequence as the build " +
"progresses — e.g. 3 entries = early / mid / late thirds of the build.")]
[SerializeField] private GameObject[] phases;
/// Number of construction phases in this set.
public int PhaseCount => phases != null ? phases.Length : 0;
/// The phase prefab at , or null if out of range.
public GameObject GetPhase(int index)
=> (phases != null && index >= 0 && index < phases.Length) ? phases[index] : null;
}
}