LANTERN P1: enemy-test gym tooling — on-demand spawn + GymTag clean-spawn

GymTag + GymEnemyRoster (+ GymRosterAuthoring) bake the gym singletons. New
DebugOp.SpawnEnemy (client SpawnEnemy wrapper + server receive case) spawns a
chosen enemy KIND (Drowner/Grindylow) from the baked roster near the sender —
replacing the wave-roster hack per the roadmap's Enemy-test GYM direction.
GoInGameServerSystem takes a GymTag branch: bypass the meta-catalog spawn guard
(a fresh gym has no CycleDirector) + seed a default Spark loadout on keys 1-4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-15 00:01:13 -07:00
parent b011a367e3
commit b92cc7196b
9 changed files with 148 additions and 2 deletions
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ada099036105741448f2c567a6324e8f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,49 @@
using System.Collections.Generic;
using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
/// <summary>
/// Bakes the Enemy-test GYM singletons: the <see cref="GymTag"/> mode switch + the <see cref="GymEnemyRoster"/>
/// buffer of on-demand-spawnable enemy prefabs (Drowner / Grindylow — the ready skinned prefabs). Place ONE in
/// the gym subscene. Each prefab must be a baked ghost (interpolated ownerless enemy, EnemyAuthoring-based). The
/// SpawnEnemy dev op instantiates the row whose Kind matches the request.
/// </summary>
public class GymRosterAuthoring : MonoBehaviour
{
[System.Serializable]
public struct Entry
{
[Tooltip("Stable kind id (0 = Drowner, 1 = Grindylow).")]
public byte Kind;
public GameObject Prefab;
}
[Tooltip("On-demand-spawnable enemy prefabs, one row per kind.")]
public List<Entry> Enemies = new List<Entry>();
private class RosterBaker : Baker<GymRosterAuthoring>
{
public override void Bake(GymRosterAuthoring authoring)
{
var entity = GetEntity(TransformUsageFlags.None);
AddComponent<GymTag>(entity);
var buf = AddBuffer<GymEnemyRoster>(entity);
if (authoring.Enemies != null)
{
foreach (var e in authoring.Enemies)
{
if (e.Prefab == null) continue;
buf.Add(new GymEnemyRoster
{
Kind = e.Kind,
Prefab = GetEntity(e.Prefab, TransformUsageFlags.Dynamic),
});
}
}
}
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d210e424c43414a4e958efc44c025335