Map Updates
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using ProjectM.Simulation;
|
||||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ProjectM.Authoring
|
||||
{
|
||||
/// <summary>
|
||||
/// Authoring for a Blight-clutter ghost prefab (ownerless interpolated — duplicate from ResourceNode.prefab
|
||||
/// so the GhostAuthoringComponent comes free). Bakes <see cref="BlightClutter"/> + <see cref="HitRadius"/>
|
||||
/// (reused for the harvest/clear sweep) + <see cref="RegionTag"/>{Expedition} so GhostRelevancy scopes it to
|
||||
/// expedition players. The field spawner overrides Variant (round-robin) + Position per instance. Defaults are
|
||||
/// inline here (mirrors ResourceNodeAuthoring), not in Tuning.
|
||||
/// </summary>
|
||||
public class BlightClutterAuthoring : MonoBehaviour
|
||||
{
|
||||
[Tooltip("Hit-points before the clutter shatters.")]
|
||||
[Min(1)] public int Remaining = 8;
|
||||
|
||||
[Tooltip("Scrap (Biomass) yielded per projectile hit — the 'minor scrap' trickle.")]
|
||||
[Min(1f)] public float ScrapPerHit = 2f;
|
||||
|
||||
[Tooltip("Hit radius (world units) for the clear sweep.")]
|
||||
[Min(0f)] public float HitRadius = 1.0f;
|
||||
|
||||
[Tooltip("Default visual variant (the spawner round-robins this per piece).")]
|
||||
public byte Variant = 0;
|
||||
|
||||
private class BlightClutterBaker : Baker<BlightClutterAuthoring>
|
||||
{
|
||||
public override void Bake(BlightClutterAuthoring authoring)
|
||||
{
|
||||
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
|
||||
AddComponent(entity, new BlightClutter
|
||||
{
|
||||
Remaining = authoring.Remaining,
|
||||
Variant = authoring.Variant,
|
||||
ScrapResourceId = ResourceId.Biomass,
|
||||
ScrapPerHit = authoring.ScrapPerHit,
|
||||
});
|
||||
AddComponent(entity, new HitRadius { Value = authoring.HitRadius });
|
||||
AddComponent(entity, new RegionTag { Region = RegionId.Expedition });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user