Skip to content

Unity Global Hub Configuration (FastTMASettings)

Central configuration hub for the FastTMA Suite, accessible via Tools → FastTMA → Settings or Edit → Project Settings → FastTMA. All fields are persisted into a single ScriptableObject asset under ProjectSettings/FastTMASettings.asset.


Access Path

MethodPath
Unity MenuTools → FastTMA → Settings
Project Settings WindowEdit → Project Settings → FastTMA

FastTMASettings Inspector


Core Field Specifications

Telegram Pay Url

  • Scope: Stars payment relay entry point. When a player initiates a Stars purchase, the runtime reads this URL and opens it in the Telegram WebView via Telegram.WebApp.openTelegramLink().
  • Validation rules:
    • Must start with https://http:// and plain hostnames are rejected.
    • Must NOT end with a trailing slash /. A trailing slash causes the Telegram SDK to double-encode the path segment and produce a 404 at the payment gateway.
  • Behaviour: If your game does not use Stars virtual currency purchases, this field may be left empty. It has zero impact on any other module (User Info, Haptics, Cloud Save, etc.).

WARNING

Leaving this field blank while a payment flow is accidentally triggered will silently fall through — no exception is thrown, but the payment intent is discarded. Always verify this field when adding a Stars purchase feature.


Enable Eruda Console

  • Scope: Mobile on-device floating debug panel providing Console, Network, and Elements tabs, powered by the Eruda library injected at build-time.

  • Behaviour: When this checkbox is ticked, the post-build processor injects the Eruda snippet into index.html. The debug gear appears automatically on real-device test runs.

  • Release hygiene requirements:

    StageEnable Eruda ConsoleAction
    Real-device debugging✅ CheckedGear visible; full console output
    Internal QA / TestFlight❌ UncheckedGear hidden; no Eruda residual
    Official store release❌ UncheckedClean build; zero Eruda traces

    The post-build step performs a strict regex sweep on index.html at the asset-generation stage. Unchecking the box guarantees removal — no manual file edits required.


Auto Optimize Compression

  • Scope: Pre-build self-healing phase that runs immediately before the WebGL IL2CPP compilation pipeline starts.

  • Core value: Defaults to Checked. Performs the following two actions automatically:

    1. WebGL Compression → Disabled
      Disables gzip / Brotli compression at the Unity Player Settings level. This prevents Unity from emitting Build.framework.js.br or .gz files that static hosting (e.g., Cloudflare Pages, Vercel, GitHub Pages) may not serve with the correct Content-Encoding: br header, causing the browser to receive compressed bytes while believing they are plain text — resulting in a white-screen or black-screen deadlock on first load.

    2. Data Caching → Enabled
      Activates Application.SetConsoleFlag("webgl_defer_compilation") equivalent behaviour, instructing the browser to cache the WebGL framework until the full binary is ready before attempting to execute it.

  • When to uncheck: Only when you are using your own server-side Brotli pipeline (e.g., Nginx with brotli_types, or a CDN with transparent Accept-Encoding: br passthrough) and are certain your hosting layer sets Content-Encoding: br correctly for every asset.


Asset Self-Healing & Connectivity Verification

Create / Rebuild Settings Asset

This button guarantees the existence of the ProjectSettings/FastTMASettings.asset ScriptableObject. Click it when:

  • The asset is accidentally deleted from the project.
  • A fresh clone of the repository is opened on a new machine.
  • The Inspector shows No FastTMASettings found in ProjectSettings/.

Clicking Create writes a new asset with all fields at their default values. Clicking Rebuild overwrites the existing asset with the values currently shown in the Inspector, serving as a manual reset.


Apply Button — 2-Second Hard-Timeout Pre-Check

When Apply is clicked, the settings pipeline executes the following sequence before committing values to the ScriptableObject:

  1. Timeout gate: A 2-second hard timer starts immediately.
  2. HTTP probe: The pipeline issues a HEAD request to the current Telegram Pay Url (if non-empty).
  3. Outcome matrix:
Probe resultTimeout hitAsset Status indicatorCommit behaviour
2xx OKNo🟢 ValidCommits immediately
3xx / 4xx / 5xxNo🟡 Reachable but unexpected statusCommits with console warning
Network error / DNS failNo🔴 UnreachableCommits with error entry in Assets/FastTMA/Editor/SettingsReport.txt
Timer expires before responseYes⚠️ TimeoutAborts commit; shows "Network unreachable — check firewall / proxy" dialog

The 2-second timeout is intentionally aggressive to prevent the Apply button from hanging indefinitely on mobile hotspot connections during a build farm run.


Asset Status State Machine

[No Asset] --Create--> [Default] --Apply--> [Pending Probe]
                                              |
                            ┌─────────────────┼─────────────────┐
                            ▼                 ▼                 ▼
                         [Valid]    [Reachable / Warn]   [Unreachable]
                            │                 │                 │
                            └────────[Asset Saved]←─────────────┘

                                         [Ready]
StateDescription
No AssetAsset file missing; Inspector shows "Not found" banner.
DefaultAsset exists; all fields at default. Apply has never been clicked.
Pending ProbeApply clicked; 2-second probe in flight.
ValidProbe returned 2xx; settings committed.
Reachable / WarnProbe returned non-2xx; committed with warning.
UnreachableProbe failed; not committed; error logged.
ReadyAsset on disk matches last committed state.

Pro Tip

Combine Auto Optimize Compression (enabled) with Build → Data Caching in your Cloudflare Pages Pages → Settings → Build configuration to achieve the lowest possible WebGL initial-load time for Telegram Mini App audiences on 4G.