ChainSafe / ChainSafe/open-creator-rails.unity
Mobile Build Support for Sample Demo
- Dominant language
- C#
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**What**
Extend the existing `SampleProject` sample demo with mobile build support for **iOS and Android**, covering two distinct areas:
1. **Mobile input:** `MovementController.cs` uses keyboard input only, and the UI toolkit layouts (`HUD.uxml`, `Landing.uxml`, `Subscribe.uxml`) have no touch controls. Add a virtual joystick and tap-to-interact button so the full subscription gating flow is operable on device.
2. **Local stack networking across devices:** The local development environment runs Anvil on `127.0.0.1:8545` and Ponder on `localhost`. A mobile device on the same LAN cannot reach `localhost` — the RPC URL in `EmbeddedWalletProvider` and the indexer URL in `PonderIndexerProvider` need to point at the host machine's LAN IP. Add runtime config support and document the setup so developers can test the SDK against a local stack from a physical device.
**Why**
The SDK is relevant to mobile game developers but the sample is currently unusable on device — keyboard-only movement means the player cannot move, and `localhost` URLs mean no blockchain or indexer calls succeed. Without both fixes, mobile developers have no working reference point for integrating the SDK into their own projects.
**How**
1. Add `com.unity.inputsystem` to `SampleProject` and migrate `MovementController.cs` to read from the Input System in addition to (not replacing) the existing keyboard path
2. Add an `OnScreenStick` (virtual joystick) and an `OnScreenButton` (interact) to the `HUD.uxml` UI, visible only when `Application.isMobilePlatform` is true
3. Update `GatedAssetTrigger.cs` to respond to the on-screen interact button tap in addition to the existing keyboard prompt
4. Extend `secrets.json` (or add a separate `config.json` in `StreamingAssets/`) with optional `rpcUrl` and `indexerUrl` override fields; when present, `EmbeddedWalletProvider` and `PonderIndexerProvider` use these values at runtime — allowing a developer to point a device at e.g. `http://192.168.x.x:8545` without recompiling
5. Document the LAN networking setup (find host IP, set override URLs, ensure Anvil binds to `0.0.0.0` not `127.0.0.1`) in `docs/local-development.md` (see issue #42)
6. Verify the `SampleProject` compiles cleanly for Android and iOS build targets (no platform-specific compile errors)
**Acceptance Criteria**
- [ ] Sample builds without errors for Android and iOS targets in `SampleProject`
- [ ] Player movement and interaction (including the subscribe flow) are fully operable via touch on a physical device
- [ ] Virtual joystick and interact button are only shown on mobile platforms — PC input paths are unaffected
- [ ] A mobile device on the same LAN can connect to a local Anvil + Ponder stack via the URL override config
- [ ] LAN networking setup is documented in `docs/local-development.md`
**Estimation**
**Dependencies**
#42 (Local Development Docs) — for the LAN networking documentation section.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing MovementController.cs, GatedAssetTrigger.cs, HUD.uxml, the two provider classes, and the existing secrets.json or StreamingAssets configuration. Review issue #42 and docs/local-development.md for the networking documentation context, then verify Android and iOS builds and physical-device touch flows; done means the listed acceptance criteria pass without changing PC input behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- documentation, game-dev, mobile-dev, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100