using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
///
/// Authoring for the baked singleton (mirrors ClutterFieldSpawnerAuthoring /
/// CoverFieldSpawnerAuthoring). Place once in the gameplay subscene and assign the geyser ghost prefab;
/// RoomFieldSystem scatters it in Blight-biome rooms (never Boss). Carries no transform.
///
public class GeyserFieldSpawnerAuthoring : MonoBehaviour
{
[Tooltip("Geyser ghost prefab. Must carry GeyserAuthoring + a GhostAuthoringComponent (ownerless, interpolated).")]
public GameObject GeyserPrefab;
[Tooltip("Number of geysers per Blight-biome room (Boss rooms get none).")]
[Min(0)] public int Count = 2;
private class GeyserFieldSpawnerBaker : Baker
{
public override void Bake(GeyserFieldSpawnerAuthoring authoring)
{
var entity = GetEntity(authoring, TransformUsageFlags.None);
AddComponent(entity, new GeyserFieldSpawner
{
Prefab = authoring.GeyserPrefab != null
? GetEntity(authoring.GeyserPrefab, TransformUsageFlags.Dynamic)
: Entity.Null,
Count = authoring.Count,
});
}
}
}
}