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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b1aa9b83194a2c41b940dd9532377f4
|
||||
@@ -0,0 +1,39 @@
|
||||
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; ExpeditionFieldSystem
|
||||
/// 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,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02623cc30f984104b88a75782bf0dd07
|
||||
Reference in New Issue
Block a user