diff --git a/brokkr-daemon/src/main.rs b/brokkr-daemon/src/main.rs index 25ca659..ca3107e 100644 --- a/brokkr-daemon/src/main.rs +++ b/brokkr-daemon/src/main.rs @@ -131,11 +131,12 @@ fn main() -> Result<()> { match command.as_str() { "provider" | "smoke" => print_provider(), "sync-contract" => print_sync_contract(), + "unity-command" => unity_command(UnityCommandArgs::parse(args.collect())?), "sync-once" => sync_once(SyncArgs::parse(args.collect())?), "sync-loop" => sync_loop(SyncLoopArgs::parse(args.collect())?), _ => { eprintln!( - "usage: brokkr-daemon [provider|smoke|sync-contract|sync-once --unity-cache PATH --blender-cache PATH [--dry-run]|sync-loop --unity-cache PATH --blender-cache PATH [--interval-ms N] [--max-passes N] [--dry-run]]" + "usage: brokkr-daemon [provider|smoke|sync-contract|unity-command --unity-cache PATH --action ACTION [--value VALUE] [--view game|scene] [--output PATH] [--width N] [--height N] [--command-id ID]|sync-once --unity-cache PATH --blender-cache PATH [--dry-run]|sync-loop --unity-cache PATH --blender-cache PATH [--interval-ms N] [--max-passes N] [--dry-run]]" ); std::process::exit(2); } @@ -180,6 +181,42 @@ fn sync_loop(args: SyncLoopArgs) -> Result<()> { } } +fn unity_command(args: UnityCommandArgs) -> Result<()> { + let command_id = args + .command_id + .unwrap_or_else(|| stable_id(["unity-command", &args.action, &chrono_like_timestamp_id()])); + let command = json!([ + "brokkr.unity.command_intent.v0", + command_id, + args.action, + "", + "", + "", + "", + args.value, + "", + "", + "", + "", + "", + args.view_kind, + args.output_path, + args.width, + args.height + ]); + let mut store = MirrorStore::open(&args.unity_cache)?; + let command_id = command[1] + .as_str() + .ok_or_else(|| anyhow!("generated Unity command has no command id"))?; + store.put_messagepack_document( + "brokkr.unity.command_intent.v0", + &format!("unity/commands/{command_id}"), + &command, + )?; + println!("{command_id}"); + Ok(()) +} + fn build_provider_advertisement() -> ProviderAdvertisement { ProviderAdvertisement { schema: PROVIDER_SCHEMA, @@ -222,6 +259,9 @@ fn build_provider_advertisement() -> ProviderAdvertisement { "gameobject.create", "component.attach", "component.property.write", + "editor.assets.refresh", + "editor.lifecycle.write", + "editor.view.capture", "sync.session.publish", "sync.object.bind", "sync.var.publish", @@ -501,6 +541,76 @@ struct SyncArgs { dry_run: bool, } +#[derive(Debug, Clone)] +struct UnityCommandArgs { + unity_cache: PathBuf, + action: String, + value: String, + view_kind: String, + output_path: String, + width: i64, + height: i64, + command_id: Option, +} + +impl UnityCommandArgs { + fn parse(args: Vec) -> Result { + let mut unity_cache = None; + let mut action = None; + let mut value = String::new(); + let mut view_kind = String::new(); + let mut output_path = String::new(); + let mut width = 0; + let mut height = 0; + let mut command_id = None; + let mut index = 0; + + while index < args.len() { + let option = args[index].as_str(); + index += 1; + let required_value = |index: usize| { + args.get(index) + .cloned() + .ok_or_else(|| anyhow!("{option} requires a value")) + }; + match option { + "--unity-cache" => unity_cache = Some(PathBuf::from(required_value(index)?)), + "--action" => action = Some(required_value(index)?), + "--value" => value = required_value(index)?, + "--view" => view_kind = required_value(index)?, + "--output" => output_path = required_value(index)?, + "--width" => { + let raw = required_value(index)?; + width = raw + .parse() + .with_context(|| format!("invalid --width value: {raw}"))?; + } + "--height" => { + let raw = required_value(index)?; + height = raw + .parse() + .with_context(|| format!("invalid --height value: {raw}"))?; + } + "--command-id" => command_id = Some(required_value(index)?), + other => return Err(anyhow!("unknown unity-command argument: {other}")), + } + index += 1; + } + + Ok(Self { + unity_cache: unity_cache + .ok_or_else(|| anyhow!("unity-command requires --unity-cache"))?, + action: action.ok_or_else(|| anyhow!("unity-command requires --action"))?, + value, + view_kind, + output_path, + width, + height, + command_id, + }) + } +} + impl SyncArgs { fn parse(args: Vec) -> Result { let parsed = ParsedSyncCli::parse(args, false)?; @@ -1992,6 +2102,52 @@ fn chrono_like_timestamp_id() -> String { mod tests { use super::*; + #[test] + fn unity_command_writes_typed_editor_lifecycle_intent() -> Result<()> { + let temp = tempfile::tempdir()?; + let cache = temp.path().join("unity-editor.ccmp"); + let args = UnityCommandArgs::parse(vec![ + "--unity-cache".into(), + cache.display().to_string(), + "--action".into(), + "captureEditorView".into(), + "--view".into(), + "scene".into(), + "--output".into(), + "artifacts/scene.png".into(), + "--width".into(), + "1280".into(), + "--height".into(), + "720".into(), + "--command-id".into(), + "capture-scene-test".into(), + ])?; + + unity_command(args)?; + + let mut store = MirrorStore::open(&cache)?; + let document = store + .documents()? + .into_iter() + .find(|item| item.key == "unity/commands/capture-scene-test") + .expect("Unity editor command should be written"); + assert_eq!( + field_string(&document.value, 2, "action").as_deref(), + Some("captureEditorView") + ); + assert_eq!( + field_string(&document.value, 13, "viewKind").as_deref(), + Some("scene") + ); + assert_eq!( + field_string(&document.value, 14, "outputPath").as_deref(), + Some("artifacts/scene.png") + ); + assert_eq!(field_i64(&document.value, 15, "width"), Some(1280)); + assert_eq!(field_i64(&document.value, 16, "height"), Some(720)); + Ok(()) + } + #[test] fn provider_advertises_muninn_owned_quest_routes_for_unity() { let provider = build_provider_advertisement(); diff --git a/docs/provider-contract.md b/docs/provider-contract.md index 713442d..ddba865 100644 --- a/docs/provider-contract.md +++ b/docs/provider-contract.md @@ -26,6 +26,9 @@ Primary Eve surface id: `brokkr.eve.tool_broker.v0` - `gameobject.create` - `component.attach` - `component.property.write` +- `editor.assets.refresh` +- `editor.lifecycle.write` +- `editor.view.capture` - `command.receipt.publish` - `eve.gui.publish` - `eve.tui.publish` @@ -72,6 +75,10 @@ Primary sync documents: Operational commands: +- `brokkr-daemon unity-command --unity-cache .brokkr/unity-editor.ccmp --action setEditorPlayState --value true` +- `brokkr-daemon unity-command --unity-cache .brokkr/unity-editor.ccmp --action setEditorPaused --value true` +- `brokkr-daemon unity-command --unity-cache .brokkr/unity-editor.ccmp --action refreshAssets` +- `brokkr-daemon unity-command --unity-cache .brokkr/unity-editor.ccmp --action captureEditorView --view scene --output artifacts/scene.png` - `brokkr-daemon sync-once --unity-cache .brokkr/unity-editor.ccmp --blender-cache .brokkr/blender-editor.ccmp` - `brokkr-daemon sync-loop --unity-cache .brokkr/unity-editor.ccmp --blender-cache .brokkr/blender-editor.ccmp --interval-ms 500` diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Editor/BrokkrUnityCommandExecutor.cs b/surfaces/unity/Packages/com.gamecult.brokkr/Editor/BrokkrUnityCommandExecutor.cs index d071672..d60984a 100644 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Editor/BrokkrUnityCommandExecutor.cs +++ b/surfaces/unity/Packages/com.gamecult.brokkr/Editor/BrokkrUnityCommandExecutor.cs @@ -1,5 +1,6 @@ using System; using System.Globalization; +using System.IO; using System.Linq; using GameCult.Brokkr; using UnityEditor; @@ -26,6 +27,10 @@ namespace GameCult.Brokkr.Editor "createPrefabVariant" => CreatePrefabVariant(command), "assignMaterial" => AssignMaterial(command), "createScriptableObject" => CreateScriptableObject(command), + "refreshAssets" => RefreshAssets(command), + "setEditorPlayState" => SetEditorPlayState(command), + "setEditorPaused" => SetEditorPaused(command), + "captureEditorView" => CaptureEditorView(command), _ => Failed(command, $"Unsupported Unity command action: {command.action}") }; } @@ -35,6 +40,106 @@ namespace GameCult.Brokkr.Editor } } + private static BrokkrUnityCommandReceipt RefreshAssets(BrokkrUnityCommand command) + { + AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate); + return Accepted(command, "Asset database refreshed.", ""); + } + + private static BrokkrUnityCommandReceipt SetEditorPlayState(BrokkrUnityCommand command) + { + if (!bool.TryParse(command.value, out var shouldPlay)) + { + return Failed(command, "Play state value must be true or false."); + } + + EditorApplication.isPlaying = shouldPlay; + return Accepted(command, shouldPlay ? "Entering Play mode." : "Leaving Play mode.", ""); + } + + private static BrokkrUnityCommandReceipt SetEditorPaused(BrokkrUnityCommand command) + { + if (!bool.TryParse(command.value, out var shouldPause)) + { + return Failed(command, "Pause state value must be true or false."); + } + + EditorApplication.isPaused = shouldPause; + return Accepted(command, shouldPause ? "Editor paused." : "Editor resumed.", ""); + } + + private static BrokkrUnityCommandReceipt CaptureEditorView(BrokkrUnityCommand command) + { + var camera = ResolveCaptureCamera(command.viewKind); + if (camera == null) + { + return Failed(command, $"No {command.viewKind} camera is available."); + } + + if (string.IsNullOrWhiteSpace(command.outputPath)) + { + return Failed(command, "Capture outputPath is required."); + } + + var projectPath = Directory.GetParent(Application.dataPath)?.FullName ?? Application.dataPath; + var outputPath = Path.GetFullPath(Path.IsPathRooted(command.outputPath) + ? command.outputPath + : Path.Combine(projectPath, command.outputPath)); + var directory = Path.GetDirectoryName(outputPath); + if (!string.IsNullOrEmpty(directory)) + { + Directory.CreateDirectory(directory); + } + + var width = command.width > 0 ? command.width : Math.Max(camera.pixelWidth, 1); + var height = command.height > 0 ? command.height : Math.Max(camera.pixelHeight, 1); + var target = RenderTexture.GetTemporary(width, height, 24, RenderTextureFormat.ARGB32, + RenderTextureReadWrite.sRGB); + var previousTarget = camera.targetTexture; + var previousActive = RenderTexture.active; + try + { + camera.targetTexture = target; + camera.Render(); + RenderTexture.active = target; + var image = new Texture2D(width, height, TextureFormat.RGBA32, false); + try + { + image.ReadPixels(new Rect(0, 0, width, height), 0, 0); + image.Apply(false, false); + File.WriteAllBytes(outputPath, image.EncodeToPNG()); + } + finally + { + UnityEngine.Object.DestroyImmediate(image); + } + } + finally + { + camera.targetTexture = previousTarget; + RenderTexture.active = previousActive; + RenderTexture.ReleaseTemporary(target); + } + + return Accepted(command, $"Captured {command.viewKind} view.", outputPath); + } + + private static Camera ResolveCaptureCamera(string viewKind) + { + if (string.Equals(viewKind, "scene", StringComparison.OrdinalIgnoreCase)) + { + return SceneView.lastActiveSceneView != null ? SceneView.lastActiveSceneView.camera : null; + } + + if (string.Equals(viewKind, "game", StringComparison.OrdinalIgnoreCase)) + { + return Camera.main ?? UnityEngine.Object.FindObjectsOfType() + .FirstOrDefault(candidate => candidate.enabled); + } + + return null; + } + private static BrokkrUnityCommandReceipt CreateGameObject(BrokkrUnityCommand command) { var gameObject = new GameObject(string.IsNullOrWhiteSpace(command.name) diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Editor/BrokkrUnitySnapshotBuilder.cs b/surfaces/unity/Packages/com.gamecult.brokkr/Editor/BrokkrUnitySnapshotBuilder.cs index 4b08eb5..35b9afe 100644 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Editor/BrokkrUnitySnapshotBuilder.cs +++ b/surfaces/unity/Packages/com.gamecult.brokkr/Editor/BrokkrUnitySnapshotBuilder.cs @@ -23,6 +23,9 @@ namespace GameCult.Brokkr.Editor "scene.tree.read", "selection.read", "asset.catalog.read", + "editor.assets.refresh", + "editor.lifecycle.write", + "editor.view.capture", "command.palette.read", "command.execute", "receipt.read" @@ -43,6 +46,10 @@ namespace GameCult.Brokkr.Editor .Select(item => item.name) .ToArray(), assetCount = AssetDatabase.GetAllAssetPaths().Length, + isPlaying = EditorApplication.isPlaying, + isPaused = EditorApplication.isPaused, + isCompiling = EditorApplication.isCompiling, + isUpdating = EditorApplication.isUpdating, capabilities = Capabilities, sceneObjects = CaptureSceneObjects(), assets = CaptureAssets() diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Editor/GameCult.Brokkr.Editor.asmdef b/surfaces/unity/Packages/com.gamecult.brokkr/Editor/GameCult.Brokkr.Editor.asmdef index ff1f756..cbbab9c 100644 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Editor/GameCult.Brokkr.Editor.asmdef +++ b/surfaces/unity/Packages/com.gamecult.brokkr/Editor/GameCult.Brokkr.Editor.asmdef @@ -29,7 +29,7 @@ "Microsoft.Bcl.TimeProvider.dll", "Microsoft.NET.StringTools.dll", "MessagePack.Annotations.dll", - "MessagePack.CultMesh.dll", + "MessagePack.dll", "R3.dll", "System.Collections.Immutable.dll", "System.IO.Pipelines.dll", diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/ConcurrentCollections.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/ConcurrentCollections.dll deleted file mode 100644 index 5ee53e7..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/ConcurrentCollections.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/ConcurrentCollections.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/ConcurrentCollections.dll.meta deleted file mode 100644 index cf0f91c..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/ConcurrentCollections.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 664ec081a56277e4c8c9d1efc3b6416f \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.MessagePack.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.MessagePack.dll deleted file mode 100644 index 1ec5161..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.MessagePack.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.MessagePack.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.MessagePack.dll.meta deleted file mode 100644 index 8e7cbd2..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.MessagePack.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 7f7d43fe0ed322446a4ae5b345a4b1a9 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.dll deleted file mode 100644 index f839280..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.dll.meta deleted file mode 100644 index 1dc87b5..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Caching.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 384dd07098d548f4cb3cdd573cba2fac \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Logging.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Logging.dll deleted file mode 100644 index 6f7e680..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Logging.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Logging.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Logging.dll.meta deleted file mode 100644 index 320c25c..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Logging.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: be58f7171a27e4641bc5c1ece94e1a0e \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Mesh.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Mesh.dll deleted file mode 100644 index 8b42fe9..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Mesh.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Mesh.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Mesh.dll.meta deleted file mode 100644 index dbbbe0e..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Mesh.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: be4ca9f17443d3b4ca054c236480ccac \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Networking.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Networking.dll deleted file mode 100644 index adb5338..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Networking.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Networking.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Networking.dll.meta deleted file mode 100644 index 1c2624e..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/GameCult.Networking.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 544b484d57520474d8b31d232b87d5bd \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Argon2.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Argon2.dll deleted file mode 100644 index ac61f4a..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Argon2.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Argon2.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Argon2.dll.meta deleted file mode 100644 index 7306bef..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Argon2.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 9403fba97394ef941ab2ab830adb0bdf \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Blake2b.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Blake2b.dll deleted file mode 100644 index d58f40d..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Blake2b.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Blake2b.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Blake2b.dll.meta deleted file mode 100644 index c10ac84..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.Blake2b.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 5f5fad94e45028b4cb6a62b62252e1a4 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.SecureArray.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.SecureArray.dll deleted file mode 100644 index 681ddda..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.SecureArray.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.SecureArray.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.SecureArray.dll.meta deleted file mode 100644 index 6b1ec4f..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Isopoh.Cryptography.SecureArray.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 941b8cae890bc58489c85b9a53eb0c52 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/LiteNetLib.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/LiteNetLib.dll deleted file mode 100644 index e804751..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/LiteNetLib.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/LiteNetLib.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/LiteNetLib.dll.meta deleted file mode 100644 index 4b3f4da..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/LiteNetLib.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: af58bbde7fb10c74891cfc94811b25e9 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.Annotations.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.Annotations.dll deleted file mode 100644 index 3c580eb..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.Annotations.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.Annotations.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.Annotations.dll.meta deleted file mode 100644 index c247a31..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.Annotations.dll.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 36d3af9ac3f57cb46b1cbd574931f69c -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 1 - validateReferences: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.CultMesh.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.CultMesh.dll deleted file mode 100644 index 4d9a7fd..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.CultMesh.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.CultMesh.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.CultMesh.dll.meta deleted file mode 100644 index 21bd5f4..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/MessagePack.CultMesh.dll.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 28ef17d784838b64cb4be5ebdc1ee8a0 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 1 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.AsyncInterfaces.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.AsyncInterfaces.dll deleted file mode 100644 index 9bfce56..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.AsyncInterfaces.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.AsyncInterfaces.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.AsyncInterfaces.dll.meta deleted file mode 100644 index 77451a6..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.AsyncInterfaces.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: bddff633377fe234b85d00b3e2764100 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.TimeProvider.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.TimeProvider.dll deleted file mode 100644 index d5b3444..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.TimeProvider.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.TimeProvider.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.TimeProvider.dll.meta deleted file mode 100644 index 47f6f0d..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.Bcl.TimeProvider.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: d2cc82d315542004b91042f6dac44368 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.NET.StringTools.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.NET.StringTools.dll deleted file mode 100644 index 9a0ab6d..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.NET.StringTools.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.NET.StringTools.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.NET.StringTools.dll.meta deleted file mode 100644 index ddf84bf..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/Microsoft.NET.StringTools.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: e68bfb4b774a27847b375e30c5ec3905 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/R3.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/R3.dll deleted file mode 100644 index e6cfd80..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/R3.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/R3.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/R3.dll.meta deleted file mode 100644 index b734a2e..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/R3.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: f3a6830e9cbbf7849a5b7f011ba74e51 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Buffers.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Buffers.dll deleted file mode 100644 index c0970c0..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Buffers.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Buffers.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Buffers.dll.meta deleted file mode 100644 index ac6b4ed..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Buffers.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 72d7f2b2b7ff7634b81428b763b45852 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Collections.Immutable.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Collections.Immutable.dll deleted file mode 100644 index 3082288..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Collections.Immutable.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Collections.Immutable.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Collections.Immutable.dll.meta deleted file mode 100644 index 4251e68..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Collections.Immutable.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 426a8a696a5c1b94fbd9dfcc04786c7d \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.ComponentModel.Annotations.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.ComponentModel.Annotations.dll deleted file mode 100644 index a5adedd..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.ComponentModel.Annotations.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.ComponentModel.Annotations.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.ComponentModel.Annotations.dll.meta deleted file mode 100644 index 46677ed..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.ComponentModel.Annotations.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: dea147d566e7d7b43a1b13c532cfcf0c \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.IO.Pipelines.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.IO.Pipelines.dll deleted file mode 100644 index 419be26..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.IO.Pipelines.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.IO.Pipelines.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.IO.Pipelines.dll.meta deleted file mode 100644 index 3d20244..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.IO.Pipelines.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: c2dc4cd724917584aa9b38f0a4bc669a \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Memory.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Memory.dll deleted file mode 100644 index 1e6aef8..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Memory.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Memory.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Memory.dll.meta deleted file mode 100644 index 8b70299..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Memory.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 6f80ea203cf635b4584cb104fba83594 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Runtime.CompilerServices.Unsafe.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Runtime.CompilerServices.Unsafe.dll deleted file mode 100644 index 491a80a..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Runtime.CompilerServices.Unsafe.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Runtime.CompilerServices.Unsafe.dll.meta deleted file mode 100644 index 4ff2880..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Runtime.CompilerServices.Unsafe.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 7bbc7179ab442cf44bf45ae6344c8766 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Encodings.Web.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Encodings.Web.dll deleted file mode 100644 index cf5ba2f..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Encodings.Web.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Encodings.Web.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Encodings.Web.dll.meta deleted file mode 100644 index 1994764..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Encodings.Web.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: d6474534f64e9594aa9cd78743056068 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Json.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Json.dll deleted file mode 100644 index fd78060..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Json.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Json.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Json.dll.meta deleted file mode 100644 index f028fae..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Text.Json.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 5f598b1f1749353408add83931bd042e \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Channels.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Channels.dll deleted file mode 100644 index 60b45fb..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Channels.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Channels.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Channels.dll.meta deleted file mode 100644 index 0afbc39..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Channels.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 0ef728200a42c6a46b150b5a3143be6f \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Tasks.Extensions.dll b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Tasks.Extensions.dll deleted file mode 100644 index dfab234..0000000 Binary files a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Tasks.Extensions.dll and /dev/null differ diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Tasks.Extensions.dll.meta b/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Tasks.Extensions.dll.meta deleted file mode 100644 index 59d9599..0000000 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Plugins/CultMesh/System.Threading.Tasks.Extensions.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: b3d0157e180a40942a31d7682f7c5674 \ No newline at end of file diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Runtime/BrokkrHostSnapshot.cs b/surfaces/unity/Packages/com.gamecult.brokkr/Runtime/BrokkrHostSnapshot.cs index 8873205..8a8d00b 100644 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Runtime/BrokkrHostSnapshot.cs +++ b/surfaces/unity/Packages/com.gamecult.brokkr/Runtime/BrokkrHostSnapshot.cs @@ -23,6 +23,10 @@ namespace GameCult.Brokkr [Key(11)] public string[] capabilities = Array.Empty(); [Key(12)] public BrokkrGameObjectSnapshot[] sceneObjects = Array.Empty(); [Key(13)] public BrokkrAssetSnapshot[] assets = Array.Empty(); + [Key(14)] public bool isPlaying; + [Key(15)] public bool isPaused; + [Key(16)] public bool isCompiling; + [Key(17)] public bool isUpdating; } [CultDocument("brokkr.unity.snapshot_receipt", "brokkr.unity.snapshot_receipt.v0")] @@ -159,6 +163,10 @@ namespace GameCult.Brokkr [Key(10)] public string localPosition = ""; [Key(11)] public string localEulerAngles = ""; [Key(12)] public string localScale = ""; + [Key(13)] public string viewKind = ""; + [Key(14)] public string outputPath = ""; + [Key(15)] public int width; + [Key(16)] public int height; } [MessagePackObject] diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/Runtime/GameCult.Brokkr.asmdef b/surfaces/unity/Packages/com.gamecult.brokkr/Runtime/GameCult.Brokkr.asmdef index 18a38c0..c9585c0 100644 --- a/surfaces/unity/Packages/com.gamecult.brokkr/Runtime/GameCult.Brokkr.asmdef +++ b/surfaces/unity/Packages/com.gamecult.brokkr/Runtime/GameCult.Brokkr.asmdef @@ -24,7 +24,7 @@ "Microsoft.Bcl.TimeProvider.dll", "Microsoft.NET.StringTools.dll", "MessagePack.Annotations.dll", - "MessagePack.CultMesh.dll", + "MessagePack.dll", "R3.dll", "System.Collections.Immutable.dll", "System.IO.Pipelines.dll", diff --git a/surfaces/unity/Packages/com.gamecult.brokkr/package.json b/surfaces/unity/Packages/com.gamecult.brokkr/package.json index f6b385f..bd7a6f0 100644 --- a/surfaces/unity/Packages/com.gamecult.brokkr/package.json +++ b/surfaces/unity/Packages/com.gamecult.brokkr/package.json @@ -4,8 +4,10 @@ "displayName": "Brokkr", "description": "Unity Editor adapter for the Brokkr CultMesh creative-tool broker.", "unity": "2022.3", + "dependencies": { + "org.gamecult.cultlib": "1.0.16" + }, "author": { "name": "GameCult" } } - diff --git a/surfaces/unity/README.md b/surfaces/unity/README.md index b8c8276..dd3c37d 100644 --- a/surfaces/unity/README.md +++ b/surfaces/unity/README.md @@ -12,22 +12,16 @@ Add this package to a Unity project's `Packages/manifest.json`: "com.gamecult.brokkr": "file:E:/Projects/Brokkr/surfaces/unity/Packages/com.gamecult.brokkr" ``` -Vendor the CultMesh runtime DLLs before opening Unity: +The host project must also resolve the released CultLib Unity package. For a +Git-based GameCult checkout, pin it explicitly in the same manifest: -```powershell -.\tools\vendor-cultmesh-unity.ps1 +```json +"org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.16" ``` -The vendor script intentionally copies the MessagePack runtime as -`MessagePack.CultMesh.dll` and removes any sibling `MessagePack.dll`. Unity -projects can already contain a `MessagePack.asmdef`, and importing a DLL with -the same filename makes Unity resolve the wrong assembly identity. Keep -`MessagePack.CultMesh.dll` and `MessagePack.Annotations.dll` on the same -MessagePack package version as CultMesh. - -The script also removes `System.Numerics.Vectors.dll`. Unity provides that -facade assembly through its reference assemblies, so the package should not -ship a second facade DLL with a different identity. +Brokkr does not carry a private CultMesh runtime. The host's CultLib package is +the single transport assembly owner, so editor commands and the rest of the +project exchange the same typed documents in the same AppDomain. Then open `GameCult > Brokkr`. @@ -40,6 +34,16 @@ In Unity: 3. Confirm `CultMesh Cache` points at `.brokkr/unity-editor.ccmp`. 4. Click `Start CultMesh Mirror`. 5. Click `Capture Snapshot`. + +The editor bridge starts automatically and executes typed commands from the +same CultCache mirror. Common lifecycle commands can be issued without UI +automation: + +```powershell +cargo run --manifest-path E:/Projects/Brokkr/brokkr-daemon/Cargo.toml -- unity-command --unity-cache .brokkr/unity-editor.ccmp --action setEditorPlayState --value true +cargo run --manifest-path E:/Projects/Brokkr/brokkr-daemon/Cargo.toml -- unity-command --unity-cache .brokkr/unity-editor.ccmp --action setEditorPaused --value true +cargo run --manifest-path E:/Projects/Brokkr/brokkr-daemon/Cargo.toml -- unity-command --unity-cache .brokkr/unity-editor.ccmp --action captureEditorView --view scene --output artifacts/scene.png +``` 6. Click `Publish Mirror`. 7. To create a ScriptableObject through the mirror, fill `ScriptableObject Type`, `Asset Name`, and `Asset Path`, then click `Create ScriptableObject Asset`. diff --git a/tools/check.ps1 b/tools/check.ps1 index 4298684..2431f7b 100644 --- a/tools/check.ps1 +++ b/tools/check.ps1 @@ -49,31 +49,14 @@ try { Assert-Contains $syncContractText "cinemachine-virtual-camera" "sync contract" $pluginRoot = Join-Path (Get-Location) "surfaces\unity\Packages\com.gamecult.brokkr\Plugins\CultMesh" - $requiredDlls = @( - "GameCult.Caching.dll", - "GameCult.Caching.MessagePack.dll", - "GameCult.Mesh.dll", - "GameCult.Networking.dll", - "MessagePack.CultMesh.dll", - "MessagePack.Annotations.dll", - "R3.dll" - ) - - foreach ($dll in $requiredDlls) { - $path = Join-Path $pluginRoot $dll - if (-not (Test-Path $path)) { - throw "Missing vendored CultMesh Unity dependency: $path" - } + $vendoredDlls = @(Get-ChildItem $pluginRoot -Filter "*.dll" -ErrorAction SilentlyContinue) + if ($vendoredDlls.Count -ne 0) { + throw "Brokkr Unity package must consume the host CultLib package, not vendor transport DLLs: $($vendoredDlls.Name -join ', ')" } - $staleMessagePackPath = Join-Path $pluginRoot "MessagePack.dll" - if (Test-Path $staleMessagePackPath) { - throw "Brokkr Unity package must not vendor MessagePack.dll; use MessagePack.CultMesh.dll to avoid colliding with Unity MessagePack.asmdef." - } - - $staleVectorsPath = Join-Path $pluginRoot "System.Numerics.Vectors.dll" - if (Test-Path $staleVectorsPath) { - throw "Brokkr Unity package must not vendor System.Numerics.Vectors.dll; Unity provides the facade assembly and duplicate versions create resolver conflicts." + $brokkrPackage = Get-Content "surfaces\unity\Packages\com.gamecult.brokkr\package.json" -Raw | ConvertFrom-Json + if ($brokkrPackage.dependencies.'org.gamecult.cultlib' -ne '1.0.16') { + throw "Brokkr Unity package must declare org.gamecult.cultlib 1.0.16 as its transport owner." } $bundledPython = Join-Path $env:USERPROFILE ".cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe" diff --git a/tools/vendor-cultmesh-unity.ps1 b/tools/vendor-cultmesh-unity.ps1 deleted file mode 100644 index e5bb328..0000000 --- a/tools/vendor-cultmesh-unity.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -$ErrorActionPreference = "Stop" - -$repoRoot = Split-Path -Parent $PSScriptRoot -$cultLibRoot = "E:\Projects\CultLib" -$pluginRoot = Join-Path $repoRoot "surfaces\unity\Packages\com.gamecult.brokkr\Plugins\CultMesh" -$staleUnityConflicts = @( - "MessagePack.dll", - "MessagePack.dll.meta", - "System.Numerics.Vectors.dll", - "System.Numerics.Vectors.dll.meta" -) - -dotnet build (Join-Path $cultLibRoot "src\GameCult.Mesh\GameCult.Mesh.csproj") -c Debug -if ($LASTEXITCODE -ne 0) { - throw "CultMesh build failed with exit code $LASTEXITCODE" -} - -New-Item -ItemType Directory -Force -Path $pluginRoot | Out-Null - -$sources = @( - (Join-Path $cultLibRoot "bin\GameCult.Mesh\Debug\netstandard2.1\GameCult.Logging.dll"), - (Join-Path $cultLibRoot "bin\GameCult.Mesh\Debug\netstandard2.1\GameCult.Caching.dll"), - (Join-Path $cultLibRoot "bin\GameCult.Mesh\Debug\netstandard2.1\GameCult.Caching.MessagePack.dll"), - (Join-Path $cultLibRoot "bin\GameCult.Mesh\Debug\netstandard2.1\GameCult.Networking.dll"), - (Join-Path $cultLibRoot "bin\GameCult.Mesh\Debug\netstandard2.1\GameCult.Mesh.dll"), - "$env:USERPROFILE\.nuget\packages\concurrenthashset\1.3.0\lib\netstandard2.0\ConcurrentCollections.dll", - "$env:USERPROFILE\.nuget\packages\isopoh.cryptography.argon2\2.0.0\lib\netstandard2.0\Isopoh.Cryptography.Argon2.dll", - "$env:USERPROFILE\.nuget\packages\isopoh.cryptography.blake2b\2.0.0\lib\netstandard2.0\Isopoh.Cryptography.Blake2b.dll", - "$env:USERPROFILE\.nuget\packages\isopoh.cryptography.securearray\2.0.0\lib\netstandard2.0\Isopoh.Cryptography.SecureArray.dll", - "$env:USERPROFILE\.nuget\packages\litenetlib\2.1.2\lib\netstandard2.1\LiteNetLib.dll", - @{ Source = "$env:USERPROFILE\.nuget\packages\messagepack\3.1.7\lib\netstandard2.1\MessagePack.dll"; Target = "MessagePack.CultMesh.dll" }, - "$env:USERPROFILE\.nuget\packages\messagepack.annotations\3.1.7\lib\netstandard2.0\MessagePack.Annotations.dll", - "$env:USERPROFILE\.nuget\packages\microsoft.bcl.asyncinterfaces\9.0.10\lib\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll", - "$env:USERPROFILE\.nuget\packages\microsoft.bcl.timeprovider\8.0.0\lib\netstandard2.0\Microsoft.Bcl.TimeProvider.dll", - "$env:USERPROFILE\.nuget\packages\microsoft.net.stringtools\17.11.4\lib\netstandard2.0\Microsoft.NET.StringTools.dll", - "$env:USERPROFILE\.nuget\packages\r3\1.3.0\lib\netstandard2.1\R3.dll", - "$env:USERPROFILE\.nuget\packages\system.buffers\4.5.1\lib\netstandard2.0\System.Buffers.dll", - "$env:USERPROFILE\.nuget\packages\system.collections.immutable\8.0.0\lib\netstandard2.0\System.Collections.Immutable.dll", - "$env:USERPROFILE\.nuget\packages\system.componentmodel.annotations\5.0.0\lib\netstandard2.1\System.ComponentModel.Annotations.dll", - "$env:USERPROFILE\.nuget\packages\system.io.pipelines\9.0.10\lib\netstandard2.0\System.IO.Pipelines.dll", - "$env:USERPROFILE\.nuget\packages\system.memory\4.5.5\lib\netstandard2.0\System.Memory.dll", - "$env:USERPROFILE\.nuget\packages\system.runtime.compilerservices.unsafe\6.0.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll", - "$env:USERPROFILE\.nuget\packages\system.text.encodings.web\9.0.10\lib\netstandard2.0\System.Text.Encodings.Web.dll", - "$env:USERPROFILE\.nuget\packages\system.text.json\9.0.10\lib\netstandard2.0\System.Text.Json.dll", - "$env:USERPROFILE\.nuget\packages\system.threading.channels\8.0.0\lib\netstandard2.1\System.Threading.Channels.dll", - "$env:USERPROFILE\.nuget\packages\system.threading.tasks.extensions\4.5.4\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll" -) - -foreach ($staleFile in $staleUnityConflicts) { - $stalePath = Join-Path $pluginRoot $staleFile - if (Test-Path $stalePath) { - Remove-Item -LiteralPath $stalePath -Force - } -} - -foreach ($source in $sources) { - if ($source -is [System.Collections.IDictionary]) { - $sourcePath = $source.Source - $targetPath = Join-Path $pluginRoot $source.Target - } - else { - $sourcePath = $source - $targetPath = Join-Path $pluginRoot (Split-Path -Leaf $sourcePath) - } - - if (!(Test-Path $sourcePath)) { - throw "Missing CultMesh Unity dependency: $sourcePath" - } - - Copy-Item -LiteralPath $sourcePath -Destination $targetPath -Force -} - -Write-Host "Vendored CultMesh Unity dependencies into $pluginRoot"