Ship S2: the prototype root is kept across scenes only in play mode

DontDestroyOnLoad throws outside play mode, so the edit-mode play smoke
failed before it reached assembly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 11:14:00 +02:00
commit 48cabc5f85

View file

@ -34,7 +34,9 @@ public static class ShipModShips
throw new InvalidOperationException($"The ship mod template prefab ({ShipModTemplate.Key}) is not loadable.");
var root = new GameObject("Mod Ship Prototypes");
root.SetActive(false);
Object.DontDestroyOnLoad(root);
// DontDestroyOnLoad is play-mode only; the edit-mode play smoke builds the same prototypes
// without it, and nothing there loads scenes.
if (Application.isPlaying) Object.DontDestroyOnLoad(root);
foreach (var hull in hulls)
{
var package = ShipModCatalog.PackageOf(catalog, hull, modsRoot);