Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gua-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
artifact-key: unity-sample
platform: LinuxX64
unity-version: auto
gua-tag: gua-v1.0.4
gua-tag: gua-v1.0.7
artifact-path: artifacts/gua
secrets:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/GuaUiLab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ private static void Build()
if (Object.FindFirstObjectByType<GuaUiLabController>() != null)
return;

Debug.developerConsoleEnabled = false;
Application.runInBackground = true;
Application.targetFrameRate = 60;
_font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
Expand Down
76 changes: 72 additions & 4 deletions Packages/com.link1345.gua/Documentation~/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,75 @@ players, reflects UI Toolkit, uGUI, and TextMeshPro runtime controls, and listen
`GUA_BRIDGE_PORT` (8765 by default). Add `GuaId` only where a stable explicit id
is required; semantic registration is otherwise automatic.

Supported in the initial release: Windows x64, Unity 6000.5 or newer, and Mono.
The package contains precompiled managed assemblies and Windows Editor/Player
native libraries. IL2CPP, other operating systems, IMGUI, and EditorWindow UI
automation are outside the supported range.
The stable support range is Windows x64, Unity 6000.5 or newer, and Mono. The
package contains precompiled managed assemblies and Windows Editor/Player native
libraries. Other IL2CPP targets, other operating systems, IMGUI, and EditorWindow
UI automation remain outside that stable range; the WebGL path below is
experimental.

## Unity WebGL and browser-native WebMCP (experimental)

WebGL builds install a tab-local `__guaUnityWebPort` from
`Runtime/Plugins/WebGL/GuaWebMcp.jslib`. A surrounding page passes it to
`gua-webmcp` with `createUnityWebGlBridge()` and `registerGuaWebMcp()`. Calls
remain in the page. Action promises resolve from request-correlated host
completion after Unity applies the action, not when it is enqueued.
UI reads and action enqueueing cross Player-only runtime entry points, so a
local Debug Inspector does not make private nodes available to browser tools.
The same bridge exposes the host-filtered World Object Tree through the
read-only `get_world_object_tree`, `find_world_objects`, and
`wait_for_world_object` tools. Shared browser-safe world contracts are provided
by `gua-world-tools`; WebMCP callers cannot elevate the runtime observation
profile or invoke actions on world objects.
When `GuaGameInputMap` initializes the input pump, the same page bridge exposes
only the matching Semantic Game Action and Raw Input capabilities. Calls wait
for correlated host completion and use a page-owned session that is released on
abort, timeout, bridge uninstall, or runtime destruction.

The WebGL build must include the Gua C ABI runtime as a WebAssembly native plugin;
the managed adapter remains a P/Invoke wrapper and does not implement another UI
model. The initial Unity bridge does not advertise screenshot support.

## Semantic game actions and raw input

Add `GuaGameInputMap` to one scene object and register only the actions intended
for automation. Game code reads semantic values with
`GuaUnityRuntime.GetGameInputValue` or subscribes to `GameInputChanged`.
Enabling **Raw Input** creates virtual keyboard, mouse, and gamepad devices with
Unity Input System 1.20.0. The adapter queues host-frame state events and
neutralizes/removes the devices when it stops. Raw capabilities are omitted
when Input System support or the opt-in map setting is unavailable.
`AllowPlayerAgentSemanticInput` and `AllowPlayerAgentRawInput` are independent,
default-off permissions for WebMCP/Public Agent callers. `EnableRawInput` alone
only initializes the local Debug path and never grants browser input access.
Physical keyboard tools accept the cross-adapter W3C code subset enumerated by
`commands.schema.json`, including left/right modifiers and common numpad operators.
When scenes change, the persistent runtime neutralizes the previous map and
publishes the `GuaGameInputMap` found in the new scene before accepting more
input.

## World objects

Add `GuaWorldObject` only to scene objects that are safe to observe. Assign a
stable `Id`, semantic `Kind`, 2D/3D space, player visibility, exposure, tags,
and primitive state explicitly:

```csharp
var door = gameObject.AddComponent<Gua.Unity.GuaWorldObject>();
door.Id = "door-a";
door.Kind = "door";
door.Space = Gua.Core.GuaWorldSpace.World2D;
door.VisibleToPlayer = true;
door.SetState("locked", true);
```

The adapter publishes global transform positions each frame and links the
nearest opted-in ancestor. It does not expose ordinary GameObjects or UI objects
automatically. Do not place secrets in labels, tags, or state.

Add `GuaAgentPolicyComponent` to a uGUI or `GuaWorldObject` GameObject to mark it
private, transform Player-visible fields, or override allowed UI actions. For UI
Toolkit and custom adapters, call `GuaUnityAdapterRegistry.SetAgentPolicy` with
the reflected target object. These policies affect Player profile only.
Enable `Override Exposure` only when the component should replace the exposure
already declared by `GuaWorldObject`; field-only policies inherit that setting.
8 changes: 0 additions & 8 deletions Packages/com.link1345.gua/Editor.meta

This file was deleted.

Binary file modified Packages/com.link1345.gua/Editor/Gua.Unity.Editor.dll
Binary file not shown.
8 changes: 0 additions & 8 deletions Packages/com.link1345.gua/Runtime.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Packages/com.link1345.gua/Runtime/Plugins.meta

This file was deleted.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions Packages/com.link1345.gua/Runtime/Plugins/Managed.meta

This file was deleted.

Binary file modified Packages/com.link1345.gua/Runtime/Plugins/Managed/Gua.Core.dll
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Packages/com.link1345.gua/Runtime/Plugins/Managed/Gua.Unity.dll
Binary file not shown.
Loading
Loading