give the runtime code assemblies, a build entry point, and fix two names

No project code is in Assembly-CSharp any more. Five assemblies: Core (no
dependencies), Locomotion.Math, Skills, Game (everything else under Scripts),
and StarterAssets.

Game is one assembly rather than one per area, which is what the plan assumed.
Measuring the dependency graph first found three cycles, all through UI —
CharacterPanelView reaches into Dialogue, PlayerControlLock into Player, and
UILayerBootstrap into Cinematics — plus two edges a using-scan cannot see,
because NPCStandIn is in the global namespace. Assemblies cannot be circular, so
splitting further means relocating those three files. That is a code-movement
task, not an asmdef task, and nothing needs it yet.

StarterAssets had to get an assembly of its own. It had none, so it lived in
Assembly-CSharp, and an asmdef assembly cannot reference the predefined
assemblies — four runtime files use it, and all four would have stopped
compiling.

The payoff is immediate: BootstrapTests no longer needs reflection to reach
NPCStandIn and CinemachineFollowsPlayer, which is exactly why Phase 3 wanted
this.

Assets/Editor/PlayerBuild.cs is the headless build entry point. It reads the
enabled scenes, asserts Bootstrap is scene 0 because the player opens scene 0 on
launch, honours the -buildOutput the CLI forwards from -o, and calls
EditorApplication.Exit(1) on anything short of Succeeded — without which Unity
exits 0 on a build that produced nothing and CI goes green on it. Verified end to
end: a 172MB .app in about two minutes.

Two renames, both different from what the plan described. DialougueSkillComparison.cs
contains a class called SkillFunctions — the filename never matched the type, so
it is now SkillFunctions.cs. The two .yarn files with spaces in their names lost
the spaces rather than becoming kebab-case, which would have made them
inconsistent with Bartender.yarn and SC101.yarn; spaces were the actual problem.
Both renames preserved their .meta GUIDs, and the yarnproject graph keys and the
two character sheets were updated.

EditMode 42/42, PlayMode 5/5, YarnCheck 9 files / 35 nodes, make build green.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
2026-08-25 21:01:27 +02:00
co-authored by Claude Opus 5
parent 40b4547c71
commit bb0f2b760c
27 changed files with 351 additions and 74 deletions
@@ -1,7 +1,6 @@
using System.Collections;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
using NightclubArcadia.Cinematics;
using Unity.Cinemachine;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -20,13 +19,6 @@ namespace NightclubArcadia.PlayMode.Tests
/// none of it has run. This can.
///
/// If this suite fails, the game does not start. Treat it that way.
///
/// Two checks reach their types by name through reflection rather than referencing
/// them. NPCStandIn and NightclubArcadia.Cinematics live in Assembly-CSharp, and an
/// assembly-definition test assembly cannot reference the predefined assemblies —
/// only the other way round. Giving the runtime code its own asmdefs
/// (docs/restructure-plan.md Phase 4.1) removes the need for this; until then the
/// reflection is the accommodation, and it is confined to these two tests.
/// </summary>
public class BootstrapTests
{
@@ -84,18 +76,12 @@ namespace NightclubArcadia.PlayMode.Tests
[Test]
public void EveryNpc_ResolvedItsDialogueRunner()
{
var npcs = Object.FindObjectsByType<MonoBehaviour>(FindObjectsInactive.Include, FindObjectsSortMode.None)
.Where(m => m != null && m.GetType().Name == "NPCStandIn")
.ToArray();
var npcs = Object.FindObjectsByType<NPCStandIn>(FindObjectsInactive.Include, FindObjectsSortMode.None);
Assert.IsNotEmpty(npcs, "Expected NPCs in the level scene");
foreach (var npc in npcs)
{
var field = npc.GetType().GetField("dialogueRunner",
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
Assert.IsNotNull(field, "NPCStandIn no longer has a dialogueRunner field");
Assert.IsNotNull(field.GetValue(npc) as Object,
Assert.IsNotNull(npc.dialogueRunner,
$"'{npc.name}' did not resolve a DialogueRunner. It lives in the Systems scene, " +
"so the serialized reference is gone and SceneServices.Resolve has to find it.");
}
@@ -104,16 +90,14 @@ namespace NightclubArcadia.PlayMode.Tests
[Test]
public void RevealCameras_BoundToThePlayer()
{
var bound = Object.FindObjectsByType<CinemachineCamera>(FindObjectsInactive.Include, FindObjectsSortMode.None)
.Where(cam => cam.GetComponents<MonoBehaviour>()
.Any(m => m != null && m.GetType().Name == "CinemachineFollowsPlayer"))
.ToArray();
Assert.IsNotEmpty(bound, "Expected at least one runtime-bound camera");
var binders = Object.FindObjectsByType<CinemachineFollowsPlayer>(
FindObjectsInactive.Include, FindObjectsSortMode.None);
Assert.IsNotEmpty(binders, "Expected at least one runtime-bound camera");
foreach (var cam in bound)
foreach (var binder in binders)
{
Assert.IsNotNull(cam.Follow,
$"'{cam.name}' never bound its Follow target to the player");
Assert.IsNotNull(binder.GetComponent<CinemachineCamera>().Follow,
$"'{binder.name}' never bound its Follow target to the player");
}
}
@@ -2,6 +2,8 @@
"name": "NightclubArcadia.PlayMode.Tests",
"rootNamespace": "NightclubArcadia.PlayMode.Tests",
"references": [
"NightclubArcadia.Game",
"NightclubArcadia.Core",
"NightclubArcadia.Skills",
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",