Files
Project-M/Assets/_Project/Scripts/Authoring/Economy/ClutterFieldSpawnerAuthoring.cs
T
kronic 7460ab9d1c Docs: hygiene sweep — stale/misattributed doc-comments + CLAUDE.md example
- Repoint CLAUDE.md testing example from the deleted HeartbeatSystemTests to HealthApplyDamageSystemTests.
- Stale deleted-system refs: ResourceFieldSpawner/ClutterFieldSpawner(+Authoring) now cite RoomFieldSystem (was ExpeditionFieldSystem); BuildPlaceRequest drops the deleted RegionTransitRequest from its 'mirrors' list.
- Stale package version: 'Netcode 1.13.2' -> 'Netcode 1.x' in ProjectileClassificationSystem + BuildPlaceRequest.
- WorldCollisionComponents: remove the duplicated EnvironmentMask summary line; FeelConfig: fix the mangled 'is hitmap)' sentence.

Comment/doc only; compiles clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 23:54:44 -07:00

40 lines
1.6 KiB
C#

using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
/// <summary>
/// Authoring for the baked <see cref="ClutterFieldSpawner"/> singleton (mirrors ResourceFieldSpawnerAuthoring).
/// Place once in the gameplay subscene and assign the Blight-clutter ghost prefab; RoomFieldSystem
/// scatters the clutter each expedition alongside the resource field. Carries no transform.
/// </summary>
public class ClutterFieldSpawnerAuthoring : MonoBehaviour
{
[Tooltip("Blight-clutter ghost prefab. Must carry BlightClutterAuthoring + a GhostAuthoringComponent (ownerless, interpolated).")]
public GameObject ClutterPrefab;
[Tooltip("Number of clutter pieces per expedition.")]
[Min(1)] public int Count = 14;
[Tooltip("Scatter radius (world units) around the expedition origin.")]
[Min(1f)] public float Radius = 14f;
private class ClutterFieldSpawnerBaker : Baker<ClutterFieldSpawnerAuthoring>
{
public override void Bake(ClutterFieldSpawnerAuthoring authoring)
{
var entity = GetEntity(authoring, TransformUsageFlags.None);
AddComponent(entity, new ClutterFieldSpawner
{
Prefab = authoring.ClutterPrefab != null
? GetEntity(authoring.ClutterPrefab, TransformUsageFlags.Dynamic)
: Entity.Null,
Count = authoring.Count,
Radius = authoring.Radius,
});
}
}
}
}