A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
feat(unity): Statecraft WebGL template, headless Web/Mac build script, Map.unity boot scene, package prune
eyalgolane721d15de652
diff --git a/.gitignore b/.gitignoreindex d03d2c567..562edfa91 100644--- a/.gitignore+++ b/.gitignore@@ -36,3 +36,4 @@ unity-*.logcaptures/unity/Assets/StreamingAssets/content/unity/Assets/StreamingAssets/content.meta+unity/Builds/diff --git a/unity/Assets/Editor/Build.cs b/unity/Assets/Editor/Build.csnew file mode 100644index 000000000..105f81805--- /dev/null+++ b/unity/Assets/Editor/Build.cs@@ -0,0 +1,67 @@+#nullable enable+using System;+using System.IO;+using System.Linq;+using UnityEditor;+using UnityEditor.Build;+using UnityEditor.Build.Reporting;+using UnityEngine;++namespace Statecraft.Game.EditorTools+{+ /// <summary>Headless player builds. Map.unity is the boot scene; ContentSync copies content/ into StreamingAssets+ /// first (IPreprocessBuildWithReport). Exits non-zero on failure.+ /// Web: Unity -batchmode -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web+ /// [-compression disabled|gzip|brotli] [-out Builds/Web-disabled]+ /// Mac: Unity -batchmode -quit -projectPath unity -buildTarget OSXUniversal -executeMethod Statecraft.Game.EditorTools.Build.Mac+ /// [-out Builds/Mac/Statecraft.app] [-ffp-contract-off]</summary>+ public static class Build+ {+ static string? Arg(string name)+ {+ var args = Environment.GetCommandLineArgs();+ var i = Array.IndexOf(args, name);+ return i >= 0 && i + 1 < args.Length ? args[i + 1] : null;+ }++ static bool Flag(string name) => Environment.GetCommandLineArgs().Contains(name);++ public static WebGLCompressionFormat Compression(string? name) => (name ?? "disabled") switch+ {+ "disabled" => WebGLCompressionFormat.Disabled,+ "gzip" => WebGLCompressionFormat.Gzip,+ "brotli" => WebGLCompressionFormat.Brotli,+ _ => throw new ArgumentException($"-compression must be disabled, gzip or brotli (got '{name}')"),+ };++ public static void Web()+ {+ var name = Arg("-compression") ?? "disabled";+ ProjectSetup.Apply();+ PlayerSettings.WebGL.compressionFormat = Compression(name);+ PlayerSettings.WebGL.decompressionFallback = false; // itch.io serves .br/.gz with Content-Encoding+ try { Run(BuildTarget.WebGL, Arg("-out") ?? "Builds/Web-" + name); }+ finally { ProjectSetup.Apply(); } // back to the committed settings (compression Disabled)+ }++ public static void Mac()+ {+ ProjectSetup.Apply();+ // Apple clang fuses a*b+c into fmadd by default (tech notes 4.2); turn it off if the Mac golden check fails.+ PlayerSettings.SetAdditionalIl2CppArgs(Flag("-ffp-contract-off") ? "--compiler-flags=-ffp-contract=off" : "");+ try { Run(BuildTarget.StandaloneOSX, Arg("-out") ?? "Builds/Mac/Statecraft.app"); }+ finally { PlayerSettings.SetAdditionalIl2CppArgs(""); AssetDatabase.SaveAssets(); }+ }++ static void Run(BuildTarget target, string location)+ {+ var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions+ {+ scenes = new[] { ProjectSetup.BootScene }, locationPathName = location, target = target, options = BuildOptions.None,+ });+ var s = report.summary;+ Debug.Log($"BUILD {s.result} {target} -> {location}: {s.totalSize / 1048576.0:0.0} MB, {s.totalErrors} errors, {s.totalTime.TotalSeconds:0}s");+ if (s.result != BuildResult.Succeeded) EditorApplication.Exit(1);+ }+ }+}diff --git a/unity/Assets/Editor/Build.cs.meta b/unity/Assets/Editor/Build.cs.metanew file mode 100644index 000000000..efd5d7aef--- /dev/null+++ b/unity/Assets/Editor/Build.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: 38d3dfdc4ab1d445e8da645fd732ff16\ No newline at end of filediff --git a/unity/Assets/Editor/ProjectSetup.cs b/unity/Assets/Editor/ProjectSetup.csindex ab08da90c..286ee7fc8 100644--- a/unity/Assets/Editor/ProjectSetup.cs+++ b/unity/Assets/Editor/ProjectSetup.cs@@ -3,17 +3,25 @@ using UnityEditor.Build;namespace Statecraft.Game.EditorTools{- /// <summary>One-time project settings (M0 API corrections): IL2CPP for Standalone and WebGL, WebGL compression off.+ /// <summary>Project settings (M0 API corrections and M3 web settings): IL2CPP for Standalone and WebGL, the+ /// Statecraft WebGL template (full-window canvas, autoSyncPersistentDataPath), compression off by default (the build+ /// script sets it per target), Map.unity as the only and first scene./// Run headless: Unity -batchmode -quit -projectPath unity -executeMethod Statecraft.Game.EditorTools.ProjectSetup.Apply</summary>public static class ProjectSetup{+ public const string BootScene = "Assets/Map.unity";+ public const string WebTemplate = "PROJECT:Statecraft";+public static void Apply(){PlayerSettings.companyName = "Statecraft";PlayerSettings.productName = "Statecraft Israel";PlayerSettings.SetScriptingBackend(NamedBuildTarget.Standalone, ScriptingImplementation.IL2CPP);PlayerSettings.SetScriptingBackend(NamedBuildTarget.WebGL, ScriptingImplementation.IL2CPP);+ PlayerSettings.WebGL.template = WebTemplate;PlayerSettings.WebGL.compressionFormat = WebGLCompressionFormat.Disabled;+ PlayerSettings.WebGL.decompressionFallback = false;+ EditorBuildSettings.scenes = new[] { new EditorBuildSettingsScene(BootScene, true) };AssetDatabase.SaveAssets();}}diff --git a/unity/Assets/Scenes/SampleScene.unity b/unity/Assets/Scenes/SampleScene.unitydeleted file mode 100644index 1c63aa8de..000000000--- a/unity/Assets/Scenes/SampleScene.unity+++ /dev/null@@ -1,432 +0,0 @@-%YAML 1.1-%TAG !u! tag:unity3d.com,2011:---- !u!29 &1-OcclusionCullingSettings:- m_ObjectHideFlags: 0- serializedVersion: 2- m_OcclusionBakeSettings:- smallestOccluder: 5- smallestHole: 0.25- backfaceThreshold: 100- m_SceneGUID: 00000000000000000000000000000000- m_OcclusionCullingData: {fileID: 0}---- !u!104 &2-RenderSettings:- m_ObjectHideFlags: 0- serializedVersion: 10- m_Fog: 0- m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}- m_FogMode: 3- m_FogDensity: 0.01- m_LinearFogStart: 0- m_LinearFogEnd: 300- m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}- m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}- m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}- m_AmbientIntensity: 1- m_AmbientMode: 0- m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}- m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}- m_HaloStrength: 0.5- m_FlareStrength: 1- m_FlareFadeSpeed: 3- m_HaloTexture: {fileID: 0}- m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}- m_DefaultReflectionMode: 0- m_DefaultReflectionResolution: 128- m_ReflectionBounces: 1- m_ReflectionIntensity: 1- m_CustomReflection: {fileID: 0}- m_Sun: {fileID: 0}- m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}- m_UseRadianceAmbientProbe: 0---- !u!157 &3-LightmapSettings:- m_ObjectHideFlags: 0- serializedVersion: 12- m_GISettings:- serializedVersion: 2- m_BounceScale: 1- m_IndirectOutputScale: 1- m_AlbedoBoost: 1- m_EnvironmentLightingMode: 0- m_EnableBakedLightmaps: 1- m_EnableRealtimeLightmaps: 0- m_LightmapEditorSettings:- serializedVersion: 12- m_Resolution: 2- m_BakeResolution: 40- m_AtlasSize: 1024- m_AO: 0- m_AOMaxDistance: 1- m_CompAOExponent: 1- m_CompAOExponentDirect: 0- m_ExtractAmbientOcclusion: 0- m_Padding: 2- m_LightmapParameters: {fileID: 0}- m_LightmapsBakeMode: 1- m_TextureCompression: 1- m_ReflectionCompression: 2- m_MixedBakeMode: 2- m_BakeBackend: 1- m_PVRSampling: 1- m_PVRDirectSampleCount: 32- m_PVRSampleCount: 512- m_PVRBounces: 2- m_PVREnvironmentSampleCount: 256- m_PVREnvironmentReferencePointCount: 2048- m_PVRFilteringMode: 1- m_PVRDenoiserTypeDirect: 1- m_PVRDenoiserTypeIndirect: 1- m_PVRDenoiserTypeAO: 1- m_PVRFilterTypeDirect: 0- m_PVRFilterTypeIndirect: 0- m_PVRFilterTypeAO: 0- m_PVREnvironmentMIS: 1- m_PVRCulling: 1- m_PVRFilteringGaussRadiusDirect: 1- m_PVRFilteringGaussRadiusIndirect: 5- m_PVRFilteringGaussRadiusAO: 2- m_PVRFilteringAtrousPositionSigmaDirect: 0.5- m_PVRFilteringAtrousPositionSigmaIndirect: 2- m_PVRFilteringAtrousPositionSigmaAO: 1- m_ExportTrainingData: 0- m_TrainingDataDestination: TrainingData- m_LightProbeSampleCountMultiplier: 4- m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}- m_LightingSettings: {fileID: 0}---- !u!196 &4-NavMeshSettings:- serializedVersion: 2- m_ObjectHideFlags: 0- m_BuildSettings:- serializedVersion: 3- agentTypeID: 0- agentRadius: 0.5- agentHeight: 2- agentSlope: 45- agentClimb: 0.4- ledgeDropHeight: 0- maxJumpAcrossDistance: 0- minRegionArea: 2- manualCellSize: 0- cellSize: 0.16666667- manualTileSize: 0- tileSize: 256- buildHeightMesh: 0- maxJobWorkers: 0- preserveTilesOutsideBounds: 0- debug:- m_Flags: 0- m_NavMeshData: {fileID: 0}---- !u!1 &330585543-GameObject:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- serializedVersion: 6- m_Component:- - component: {fileID: 330585546}- - component: {fileID: 330585545}- - component: {fileID: 330585544}- - component: {fileID: 330585547}- m_Layer: 0- m_Name: Main Camera- m_TagString: MainCamera- m_Icon: {fileID: 0}- m_NavMeshLayer: 0- m_StaticEditorFlags: 0- m_IsActive: 1---- !u!81 &330585544-AudioListener:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 330585543}- m_Enabled: 1---- !u!20 &330585545-Camera:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 330585543}- m_Enabled: 1- serializedVersion: 2- m_ClearFlags: 1- m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}- m_projectionMatrixMode: 1- m_GateFitMode: 2- m_FOVAxisMode: 0- m_Iso: 200- m_ShutterSpeed: 0.005- m_Aperture: 16- m_FocusDistance: 10- m_FocalLength: 50- m_BladeCount: 5- m_Curvature: {x: 2, y: 11}- m_BarrelClipping: 0.25- m_Anamorphism: 0- m_SensorSize: {x: 36, y: 24}- m_LensShift: {x: 0, y: 0}- m_NormalizedViewPortRect:- serializedVersion: 2- x: 0- y: 0- width: 1- height: 1- near clip plane: 0.3- far clip plane: 1000- field of view: 60- orthographic: 0- orthographic size: 5- m_Depth: -1- m_CullingMask:- serializedVersion: 2- m_Bits: 4294967295- m_RenderingPath: -1- m_TargetTexture: {fileID: 0}- m_TargetDisplay: 0- m_TargetEye: 3- m_HDR: 1- m_AllowMSAA: 1- m_AllowDynamicResolution: 0- m_ForceIntoRT: 0- m_OcclusionCulling: 1- m_StereoConvergence: 10- m_StereoSeparation: 0.022---- !u!4 &330585546-Transform:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 330585543}- serializedVersion: 2- m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}- m_LocalPosition: {x: 0, y: 1, z: -10}- m_LocalScale: {x: 1, y: 1, z: 1}- m_ConstrainProportionsScale: 0- m_Children: []- m_Father: {fileID: 0}- m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}---- !u!114 &330585547-MonoBehaviour:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 330585543}- m_Enabled: 1- m_EditorHideFlags: 0- m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}- m_Name:- m_EditorClassIdentifier:- m_RenderShadows: 1- m_RequiresDepthTextureOption: 2- m_RequiresOpaqueTextureOption: 2- m_CameraType: 0- m_Cameras: []- m_RendererIndex: -1- m_VolumeLayerMask:- serializedVersion: 2- m_Bits: 1- m_VolumeTrigger: {fileID: 0}- m_VolumeFrameworkUpdateModeOption: 2- m_RenderPostProcessing: 1- m_Antialiasing: 0- m_AntialiasingQuality: 2- m_StopNaN: 0- m_Dithering: 0- m_ClearDepth: 1- m_AllowXRRendering: 1- m_AllowHDROutput: 1- m_UseScreenCoordOverride: 0- m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}- m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}- m_RequiresDepthTexture: 0- m_RequiresColorTexture: 0- m_Version: 2- m_TaaSettings:- quality: 3- frameInfluence: 0.1- jitterScale: 1- mipBias: 0- varianceClampScale: 0.9- contrastAdaptiveSharpening: 0---- !u!1 &410087039-GameObject:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- serializedVersion: 6- m_Component:- - component: {fileID: 410087041}- - component: {fileID: 410087040}- - component: {fileID: 410087042}- m_Layer: 0- m_Name: Directional Light- m_TagString: Untagged- m_Icon: {fileID: 0}- m_NavMeshLayer: 0- m_StaticEditorFlags: 0- m_IsActive: 1---- !u!108 &410087040-Light:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 410087039}- m_Enabled: 1- serializedVersion: 11- m_Type: 1- m_Color: {r: 1, g: 1, b: 1, a: 1}- m_Intensity: 2- m_Range: 10- m_SpotAngle: 30- m_InnerSpotAngle: 21.80208- m_CookieSize: 10- m_Shadows:- m_Type: 2- m_Resolution: -1- m_CustomResolution: -1- m_Strength: 1- m_Bias: 0.05- m_NormalBias: 0.4- m_NearPlane: 0.2- m_CullingMatrixOverride:- e00: 1- e01: 0- e02: 0- e03: 0- e10: 0- e11: 1- e12: 0- e13: 0- e20: 0- e21: 0- e22: 1- e23: 0- e30: 0- e31: 0- e32: 0- e33: 1- m_UseCullingMatrixOverride: 0- m_Cookie: {fileID: 0}- m_DrawHalo: 0- m_Flare: {fileID: 0}- m_RenderMode: 0- m_CullingMask:- serializedVersion: 2- m_Bits: 4294967295- m_RenderingLayerMask: 1- m_Lightmapping: 4- m_LightShadowCasterMode: 0- m_AreaSize: {x: 1, y: 1}- m_BounceIntensity: 1- m_ColorTemperature: 5000- m_UseColorTemperature: 1- m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}- m_UseBoundingSphereOverride: 0- m_UseViewFrustumForShadowCasterCull: 1- m_ForceVisible: 0- m_ShadowRadius: 0- m_ShadowAngle: 0---- !u!4 &410087041-Transform:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 410087039}- serializedVersion: 2- m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}- m_LocalPosition: {x: 0, y: 3, z: 0}- m_LocalScale: {x: 1, y: 1, z: 1}- m_ConstrainProportionsScale: 0- m_Children: []- m_Father: {fileID: 0}- m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}---- !u!114 &410087042-MonoBehaviour:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 410087039}- m_Enabled: 1- m_EditorHideFlags: 0- m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}- m_Name:- m_EditorClassIdentifier:- m_Version: 3- m_UsePipelineSettings: 1- m_AdditionalLightsShadowResolutionTier: 2- m_LightLayerMask: 1- m_RenderingLayers: 1- m_CustomShadowLayers: 0- m_ShadowLayerMask: 1- m_ShadowRenderingLayers: 1- m_LightCookieSize: {x: 1, y: 1}- m_LightCookieOffset: {x: 0, y: 0}- m_SoftShadowQuality: 1---- !u!1 &832575517-GameObject:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- serializedVersion: 6- m_Component:- - component: {fileID: 832575519}- - component: {fileID: 832575518}- m_Layer: 0- m_Name: Global Volume- m_TagString: Untagged- m_Icon: {fileID: 0}- m_NavMeshLayer: 0- m_StaticEditorFlags: 0- m_IsActive: 1---- !u!114 &832575518-MonoBehaviour:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 832575517}- m_Enabled: 1- m_EditorHideFlags: 0- m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}- m_Name:- m_EditorClassIdentifier:- m_IsGlobal: 1- priority: 0- blendDistance: 0- weight: 1- sharedProfile: {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2}---- !u!4 &832575519-Transform:- m_ObjectHideFlags: 0- m_CorrespondingSourceObject: {fileID: 0}- m_PrefabInstance: {fileID: 0}- m_PrefabAsset: {fileID: 0}- m_GameObject: {fileID: 832575517}- serializedVersion: 2- m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}- m_LocalPosition: {x: 0, y: 0, z: 0}- m_LocalScale: {x: 1, y: 1, z: 1}- m_ConstrainProportionsScale: 0- m_Children: []- m_Father: {fileID: 0}- m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}---- !u!1660057539 &9223372036854775807-SceneRoots:- m_ObjectHideFlags: 0- m_Roots:- - {fileID: 330585546}- - {fileID: 410087041}- - {fileID: 832575519}diff --git a/unity/Assets/Tests/EditMode/ProjectSettingsTests.cs b/unity/Assets/Tests/EditMode/ProjectSettingsTests.csnew file mode 100644index 000000000..95c1047c3--- /dev/null+++ b/unity/Assets/Tests/EditMode/ProjectSettingsTests.cs@@ -0,0 +1,38 @@+using System.IO;+using System.Linq;+using NUnit.Framework;+using UnityEditor;+using UnityEditor.Build;++/// <summary>The M3 player settings (ProjectSetup.Apply) and the custom WebGL template.</summary>+public class ProjectSettingsTests+{+ [Test]+ public void PlayersUseIl2CppTheStatecraftTemplateAndMapUnityAsTheBootScene()+ {+ Assert.AreEqual(ScriptingImplementation.IL2CPP, PlayerSettings.GetScriptingBackend(NamedBuildTarget.WebGL));+ Assert.AreEqual(ScriptingImplementation.IL2CPP, PlayerSettings.GetScriptingBackend(NamedBuildTarget.Standalone));+ Assert.AreEqual("PROJECT:Statecraft", PlayerSettings.WebGL.template);+ Assert.IsFalse(PlayerSettings.WebGL.decompressionFallback);+ Assert.AreEqual(new[] { "Assets/Map.unity" }, EditorBuildSettings.scenes.Select(s => s.path).ToArray());+ }++ [Test]+ public void TheTemplateFillsTheWindowAndPersistsSaves()+ {+ var html = File.ReadAllText("Assets/WebGLTemplates/Statecraft/index.html");+ StringAssert.Contains("#unity-canvas { position: fixed; left: 0; top: 0; width: 100%; height: 100%;", html);+ StringAssert.Contains("autoSyncPersistentDataPath: true", html);+ StringAssert.DoesNotContain("alert(", html);+ }++ [Test]+ public void TemplatePackagesAreGone()+ {+ var manifest = File.ReadAllText("Packages/manifest.json");+ foreach (var p in new[] { "com.unity.ai.navigation", "com.unity.collab-proxy", "com.unity.multiplayer.center",+ "com.unity.visualscripting", "com.unity.timeline", "com.unity.ugui" })+ StringAssert.DoesNotContain("\"" + p + "\"", manifest);+ Assert.IsFalse(File.Exists("Assets/Scenes/SampleScene.unity"));+ }+}diff --git a/unity/Assets/Tests/EditMode/ProjectSettingsTests.cs.meta b/unity/Assets/Tests/EditMode/ProjectSettingsTests.cs.metanew file mode 100644index 000000000..82b0123de--- /dev/null+++ b/unity/Assets/Tests/EditMode/ProjectSettingsTests.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: cf67d46150cd8470d905f7e90bca3518\ No newline at end of filediff --git a/unity/Assets/Scenes.meta b/unity/Assets/WebGLTemplates.metasimilarity index 77%rename from unity/Assets/Scenes.metarename to unity/Assets/WebGLTemplates.metaindex b0e3b3f28..e07227622 100644--- a/unity/Assets/Scenes.meta+++ b/unity/Assets/WebGLTemplates.meta@@ -1,5 +1,5 @@fileFormatVersion: 2-guid: 5e3afd1f5ad1e4789875a4ab3cf0cc51+guid: 0e271b3aed57c45d0ad354ff88996705folderAsset: yesDefaultImporter:externalObjects: {}diff --git a/unity/Assets/WebGLTemplates/Statecraft.meta b/unity/Assets/WebGLTemplates/Statecraft.metanew file mode 100644index 000000000..2a5772aa6--- /dev/null+++ b/unity/Assets/WebGLTemplates/Statecraft.meta@@ -0,0 +1,8 @@+fileFormatVersion: 2+guid: 03fee7624ac974e8f8fcd8e88cfb7cf9+folderAsset: yes+DefaultImporter:+ externalObjects: {}+ userData:+ assetBundleName:+ assetBundleVariant:diff --git a/unity/Assets/WebGLTemplates/Statecraft/index.html b/unity/Assets/WebGLTemplates/Statecraft/index.htmlnew file mode 100644index 000000000..5fd480699--- /dev/null+++ b/unity/Assets/WebGLTemplates/Statecraft/index.html@@ -0,0 +1,58 @@+<!DOCTYPE html>+<html lang="en-us">+ <head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=no">+ <title>{{{ PRODUCT_NAME }}}</title>+ <style>+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #0e1626; }+ #unity-canvas { position: fixed; left: 0; top: 0; width: 100%; height: 100%; background: #0e1626; display: block; }+ #loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #ece4d2;+ font: 20px Georgia, "Times New Roman", serif; text-align: center; }+ #bar { width: 320px; height: 4px; margin-top: 12px; border: 1px solid #c4a05c; }+ #fill { width: 0; height: 100%; background: #c4a05c; }+ #error { display: none; position: fixed; left: 10%; right: 10%; top: 40%; color: #de7868; background: #0e1626;+ border: 1px solid #c4a05c; padding: 16px; font: 16px Georgia, serif; white-space: pre-wrap; }+ </style>+ </head>+ <body>+ <canvas id="unity-canvas" tabindex="-1"></canvas>+ <div id="loading">Statecraft: Israel<div id="bar"><div id="fill"></div></div></div>+ <div id="error"></div>+ <script src="Build/{{{ LOADER_FILENAME }}}"></script>+ <script>+ // Full-window canvas: Unity keeps the render size matched to the canvas's CSS size, so the UI Toolkit panel+ // (ScaleWithScreenSize, 1920x1080, match 0.5) rescales on every browser resize.+ var config = {+ arguments: [],+ dataUrl: "Build/{{{ DATA_FILENAME }}}",+ frameworkUrl: "Build/{{{ FRAMEWORK_FILENAME }}}",+#if USE_THREADS+ workerUrl: "Build/{{{ WORKER_FILENAME }}}",+#endif+#if USE_WASM+ codeUrl: "Build/{{{ CODE_FILENAME }}}",+#endif+#if SYMBOLS_FILENAME+ symbolsUrl: "Build/{{{ SYMBOLS_FILENAME }}}",+#endif+ streamingAssetsUrl: "StreamingAssets",+ companyName: {{{ JSON.stringify(COMPANY_NAME) }}},+ productName: {{{ JSON.stringify(PRODUCT_NAME) }}},+ productVersion: {{{ JSON.stringify(PRODUCT_VERSION) }}},+ // Persist writes under /idbfs to IndexedDB when a file is closed (tech notes section 3): saves need no manual sync.+ autoSyncPersistentDataPath: true,+ };+ createUnityInstance(document.querySelector("#unity-canvas"), config, function (progress) {+ document.getElementById("fill").style.width = (100 * progress) + "%";+ }).then(function () {+ document.getElementById("loading").style.display = "none";+ }).catch(function (message) {+ var e = document.getElementById("error");+ e.textContent = "Statecraft could not start:\n" + message;+ e.style.display = "block";+ console.error("BOOT FAIL " + message);+ });+ </script>+ </body>+</html>diff --git a/unity/Assets/Scenes/SampleScene.unity.meta b/unity/Assets/WebGLTemplates/Statecraft/index.html.metasimilarity index 74%rename from unity/Assets/Scenes/SampleScene.unity.metarename to unity/Assets/WebGLTemplates/Statecraft/index.html.metaindex 9531828bc..cb0385663 100644--- a/unity/Assets/Scenes/SampleScene.unity.meta+++ b/unity/Assets/WebGLTemplates/Statecraft/index.html.meta@@ -1,5 +1,5 @@fileFormatVersion: 2-guid: 99c9720ab356a0642a771bea13969a05+guid: 8290493a5e1da4bfc82d1eb3598876c5DefaultImporter:externalObjects: {}userData:diff --git a/unity/Packages/manifest.json b/unity/Packages/manifest.jsonindex cd03a43b6..fbf84ebd1 100644--- a/unity/Packages/manifest.json+++ b/unity/Packages/manifest.json@@ -1,16 +1,10 @@{"dependencies": {- "com.unity.ai.navigation": "2.0.14",- "com.unity.collab-proxy": "2.13.6","com.unity.ide.rider": "3.0.40","com.unity.ide.visualstudio": "2.0.26","com.unity.inputsystem": "1.20.0",- "com.unity.multiplayer.center": "1.0.1","com.unity.render-pipelines.universal": "17.3.0","com.unity.test-framework": "1.6.0",- "com.unity.timeline": "1.8.13",- "com.unity.ugui": "2.0.0",- "com.unity.visualscripting": "1.9.12","com.unity.modules.accessibility": "1.0.0","com.unity.modules.adaptiveperformance": "1.0.0","com.unity.modules.ai": "1.0.0",diff --git a/unity/Packages/packages-lock.json b/unity/Packages/packages-lock.jsonindex eda0ed326..970beb42c 100644--- a/unity/Packages/packages-lock.json+++ b/unity/Packages/packages-lock.json@@ -1,14 +1,5 @@{"dependencies": {- "com.unity.ai.navigation": {- "version": "2.0.14",- "depth": 0,- "source": "registry",- "dependencies": {- "com.unity.modules.ai": "1.0.0"- },- "url": "https://packages.unity.com"- },"com.unity.burst": {"version": "1.8.30","depth": 2,@@ -19,13 +10,6 @@},"url": "https://packages.unity.com"},- "com.unity.collab-proxy": {- "version": "2.13.6",- "depth": 0,- "source": "registry",- "dependencies": {},- "url": "https://packages.unity.com"- },"com.unity.collections": {"version": "2.6.8","depth": 2,@@ -79,14 +63,6 @@"dependencies": {},"url": "https://packages.unity.com"},- "com.unity.multiplayer.center": {- "version": "1.0.1",- "depth": 0,- "source": "builtin",- "dependencies": {- "com.unity.modules.uielements": "1.0.0"- }- },"com.unity.nuget.mono-cecil": {"version": "1.11.6","depth": 3,@@ -162,37 +138,15 @@},"url": "https://packages.unity.com"},- "com.unity.timeline": {- "version": "1.8.13",- "depth": 0,- "source": "registry",- "dependencies": {- "com.unity.modules.audio": "1.0.0",- "com.unity.modules.director": "1.0.0",- "com.unity.modules.animation": "1.0.0",- "com.unity.modules.particlesystem": "1.0.0"- },- "url": "https://packages.unity.com"- },"com.unity.ugui": {"version": "2.0.0",- "depth": 0,+ "depth": 2,"source": "builtin","dependencies": {"com.unity.modules.ui": "1.0.0","com.unity.modules.imgui": "1.0.0"}},- "com.unity.visualscripting": {- "version": "1.9.12",- "depth": 0,- "source": "registry",- "dependencies": {- "com.unity.ugui": "2.0.0",- "com.unity.modules.jsonserialize": "1.0.0"- },- "url": "https://packages.unity.com"- },"com.unity.modules.accessibility": {"version": "1.0.0","depth": 0,diff --git a/unity/ProjectSettings/ProjectSettings.asset b/unity/ProjectSettings/ProjectSettings.assetindex 4c7cefdea..f1839dcb1 100644--- a/unity/ProjectSettings/ProjectSettings.asset+++ b/unity/ProjectSettings/ProjectSettings.asset@@ -809,7 +809,7 @@ PlayerSettings:webGLDebugSymbols: 0webGLEmscriptenArgs:webGLModulesDirectory:- webGLTemplate: APPLICATION:Default+ webGLTemplate: PROJECT:StatecraftwebGLAnalyzeBuildSize: 0webGLUseEmbeddedResources: 0webGLCompressionFormat: 2