The scenes were never destroyed. Pressing Play with only Bootstrap open means GameBootstrap loads Systems and the level at runtime, and Unity discards runtime-loaded scenes when Play ends, restoring whatever the Editor had open — Bootstrap alone. The Hierarchy comes back nearly empty. Every scene file was byte-identical to HEAD throughout, still text. Tools > Nightclub Arcadia > Open Game Scenes opens all three with the level active, which is the authoring setup. With them already open, GameBootstrap's LoadIfNeeded skips them and they survive Play. GameSceneWorkflow also captures the scene setup before Play and restores it afterwards as a safety net, skipping the restore when Unity already got it right and ignoring scenes deleted meanwhile — an exception in that callback would leave the Editor in a worse state than the problem it fixes. Toggleable under the same menu. Also fixes `make lock`, which had a self-matching bug since Phase 1: `pgrep -f` on the full binary path matched the very shell running the check, because the pattern appears in its own command line. It reported the Editor as running when nothing was, and would have blocked every make test/build once anything else matched. Now `pgrep -x Unity`, which matches the process name and cannot match the shell. EditMode 42/42, PlayMode 6/6, YarnCheck 9 files / 35 nodes. Co-Authored-By: Claude Opus 5 <[email protected]>
74 lines
3.3 KiB
Makefile
74 lines
3.3 KiB
Makefile
# Nightclub Arcadia — common commands.
|
|
#
|
|
# Everything here is documented in CLAUDE.md; this file exists so the exact
|
|
# invocations live in one place instead of being retyped from memory.
|
|
|
|
UNITY_CLI ?= /Users/lennart/.unity/bin/unity
|
|
UNITY ?= /Applications/Unity/Hub/Editor/6000.5.8f1/Unity.app/Contents/MacOS/Unity
|
|
PROJECT ?= $(CURDIR)/NightclubArcadia
|
|
RESULTS ?= $(CURDIR)/.test-results
|
|
SMARTMERGE ?= /Applications/Unity/Hub/Editor/6000.5.8f1/Unity.app/Contents/Helpers/UnityYAMLMerge
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
.PHONY: help check yarn yarn-play voices voices-sync test test-play build lock clean-results merge-driver
|
|
|
|
help: ## Show this help
|
|
@grep -hE '^[a-z-]+:.*?## ' $(MAKEFILE_LIST) \
|
|
| awk 'BEGIN {FS = ":.*?## "} {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
|
|
@echo ""
|
|
@echo " Unity must be CLOSED for test/build — run 'make lock' to check."
|
|
|
|
check: yarn voices test test-play ## Everything a change should pass before commit
|
|
|
|
yarn: ## Compile every Yarn script (seconds, no Unity)
|
|
@cd tools/YarnCheck && DOTNET_CLI_TELEMETRY_OPTOUT=1 dotnet run -- ../../NightclubArcadia/Assets/Dialogue
|
|
|
|
yarn-play: ## Play a node: make yarn-play NODE=Bartender_Talk PICKS="2 2 0 0"
|
|
@cd tools/YarnCheck && DOTNET_CLI_TELEMETRY_OPTOUT=1 \
|
|
dotnet run -- ../../NightclubArcadia/Assets/Dialogue $(NODE) $(PICKS)
|
|
|
|
voices: ## Check writing/voices/*.md against skill_bible.json
|
|
@python3 tools/writing/sync_voices.py --check
|
|
|
|
voices-sync: ## Fold edited voice prose into skill_bible.json
|
|
@python3 tools/writing/sync_voices.py --to-json
|
|
|
|
test: lock ## Run the EditMode suite
|
|
@mkdir -p $(RESULTS)
|
|
@$(UNITY_CLI) test $(PROJECT) --no-banner --mode EditMode \
|
|
--output $(RESULTS)/editmode.xml --timeout 900 || true
|
|
@python3 tools/ci/report_tests.py $(RESULTS)/editmode.xml
|
|
|
|
test-play: lock ## Run the PlayMode suite (bootstrap + scene split)
|
|
@mkdir -p $(RESULTS)
|
|
@$(UNITY_CLI) test $(PROJECT) --no-banner --mode PlayMode \
|
|
--output $(RESULTS)/playmode.xml --timeout 900 || true
|
|
@python3 tools/ci/report_tests.py $(RESULTS)/playmode.xml
|
|
|
|
build: lock ## Build a macOS player into build/
|
|
@$(UNITY_CLI) build $(PROJECT) --no-banner --target StandaloneOSX \
|
|
--execute-method NightclubArcadia.EditorTools.PlayerBuild.BuildMacOS \
|
|
-o $(CURDIR)/build/NightclubArcadia.app
|
|
|
|
lock: ## Fail if the Unity Editor has the project open
|
|
# pgrep -x matches the process NAME only. The previous `pgrep -f` on the full
|
|
# binary path matched this very shell, because the pattern appears in its own
|
|
# command line — the check reported the Editor running when nothing was.
|
|
# AssetImportWorkers share the name but only exist alongside an Editor, so
|
|
# matching them is correct rather than a false positive.
|
|
@if pgrep -x Unity > /dev/null 2>&1; then \
|
|
echo "The Unity Editor is running — close it first (only one instance per project)."; \
|
|
exit 1; \
|
|
fi
|
|
|
|
merge-driver: ## One-time: teach git to merge Unity YAML with UnityYAMLMerge
|
|
@test -x "$(SMARTMERGE)" || { echo "UnityYAMLMerge not found at $(SMARTMERGE)"; exit 1; }
|
|
@git config merge.unityyamlmerge.name "Unity SmartMerge"
|
|
@git config merge.unityyamlmerge.driver "'$(SMARTMERGE)' merge -p --force --fallback none %O %B %A %A"
|
|
@git config merge.unityyamlmerge.recursive binary
|
|
@echo "configured: $$(git config merge.unityyamlmerge.name)"
|
|
|
|
clean-results: ## Remove local test results
|
|
@rm -rf $(RESULTS)
|