Feature: per-tower construction-phase build bisuals

Adding the correct pipeline for creating the different building phases for towers. Adding a default set with primitive cubes.
This commit is contained in:
Matt F 2026-06-25 11:33:23 -07:00
parent a87b221d87
commit 7b93137216
16 changed files with 594 additions and 36 deletions

View file

@ -0,0 +1,32 @@
// Assets/_Project/Scripts/Towers/ConstructionPhaseSet.cs
using UnityEngine;
namespace TD.Towers
{
/// <summary>
/// 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 <see cref="TowerDefinition.ConstructionPhases"/>; build sites fall back to a
/// project-default set when a tower doesn't define one.
/// </summary>
/// <remarks>
/// The entries are <b>shape</b> prefabs only. <c>BuildSiteVisual</c> 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.
/// </remarks>
[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;
/// <summary>Number of construction phases in this set.</summary>
public int PhaseCount => phases != null ? phases.Length : 0;
/// <summary>The phase prefab at <paramref name="index"/>, or null if out of range.</summary>
public GameObject GetPhase(int index)
=> (phases != null && index >= 0 && index < phases.Length) ? phases[index] : null;
}
}