Not Exposed
TL;DR: If a .NET / Unity symbol does not have a binder link and is not stubbed by the WASI layer, calls fall through to BindingManager.FillNonLinkedWithEmptyStubs and silently no-op. This page enumerates the conspicuous absences and the CVR-approved replacements.
Rule of thumb
Section titled “Rule of thumb”- Allow-list by generation — only types that have a file in
CVR-GameFiles/WasmBinder.Links.*/or a manual binding inWasmBinder.LinksManual.UnityEngine/or a hand-written binding inWasmScripting/*Bindings.csare reachable. - Anything else is either (a) filled with an empty stub at instantiation time or (b) filtered out by the CCKWasmModule shim at compile time.
ScriptableObject
Section titled “ScriptableObject”Not supported. A [SerializeField] public MyScriptableObject data; field on a WasmBehaviour is skipped by the serializer — it doesn’t cross the build boundary and is null at runtime.
Substitutions:
- Replace shared data with a
[WasmSerialized]custom class on aWasmBehaviourcomponent, or plain fields on a “config”WasmBehaviourthat lives on a well-known GameObject in your content. - For inspector-editable asset-style data, pack it into arrays of serializable fields on the behaviour.
UnityEngine.Application
Section titled “UnityEngine.Application”Not bound. Common substitutions:
Application.platform,.version,.productName— not available. If you need to branch, use the CCKCVR_SCRIPTING_CONTEXT_*preprocessor defines at compile time.Application.Quit()— not available. CVR controls the process lifetime.Application.isPlaying— not available. You are always running; there is no editor play mode from the guest’s perspective.
UnityEngine.Input
Section titled “UnityEngine.Input”Not bound. CVR is VR-first, so hooking into keyboard/mouse at this level would be misleading anyway. Substitutions:
- Interactions — use CVR’s
CVRPointer,CVRInteractable, or bindable CCK components with persistent UnityEvents. See Unity Events Rewiring. - VR controller buttons — surfaced via CCK input components (e.g.
CVRInputManager/ CCKAvatarInput) and theOnInputReadygame event, not viaUnityEngine.Input.
UnityEngine.Screen
Section titled “UnityEngine.Screen”Not bound. Screen size / orientation / resolution are not meaningful for a script that doesn’t own the window — they belong to CVR.
UnityEngine.PlayerPrefs
Section titled “UnityEngine.PlayerPrefs”Not bound. Substitution:
- World-scoped persistence — File Storage (requires world permission).
- Per-avatar or per-prop persistence — not directly supported. Use network messages to sync transient state across clients and rely on the host for instance lifetime.
UnityEngine.Resources / AssetBundle
Section titled “UnityEngine.Resources / AssetBundle”Not bound. Loading new assets at runtime from outside the original CCK upload is forbidden — otherwise the content-integrity model (signed uploads, per-content permissions) breaks.
- You can still reference any asset that shipped with your avatar/world/prop via regular field references (serialized
UnityEngine.Objectfields).
UnityEngine.Application / OnApplicationX events
Section titled “UnityEngine.Application / OnApplicationX events”Already covered in Events. Disallowed:
OnServerInitialized,OnConnectedToServerOnGUIOnApplicationQuit,OnApplicationFocus,OnApplicationPause
Define them — they will be detected and ignored.
UnityEngine.SceneManagement (runtime)
Section titled “UnityEngine.SceneManagement (runtime)”Only the Scene struct is bound. Not bound:
SceneManager.LoadScene*SceneManager.UnloadScene*- Scene instantiation APIs
CVR manages world scene loading itself (portals, instance joins). Scripts observe scene state — they do not drive it.
System.IO
Section titled “System.IO”Not bound. The WASI filesystem imports (fd_close, fd_read, fd_write, fd_seek, fd_filestat_get, fd_fdstat_get, fd_prestat_get, …) are stubbed to return 8 (WASI EBADF). path_open / path_filestat_get / path_readlink / path_unlink_file return 0 but never produce data. environ_get / environ_sizes_get return 0 with empty output. clock_time_get is implemented (real-time and monotonic clocks), random_get + mono_wasm_browser_entropy fill the buffer with Random.NextBytes. See CVR-GameFiles/WasmScripting/WasmStubs.cs.
- Persistent state — File Storage.
- In-module resources — pack them into the
.wasmviadotnet publishembedded resources and read viaSystem.Reflection.Assembly.GetManifestResourceStream. (RequiresenableReflectionon the descriptor.)
System.Net / System.Net.Sockets
Section titled “System.Net / System.Net.Sockets”Not bound. No raw TCP / UDP.
- Player-to-player messaging — Networking.
- External HTTP — gated by the
HttpApiAllowed+HttpAllowedDomainsworld permissions. See World Permissions.
System.Diagnostics.Process
Section titled “System.Diagnostics.Process”Not bound. No subprocess spawning. Wasmtime would refuse anyway — WASI’s process APIs are only stubs.
System.Reflection.Emit
Section titled “System.Reflection.Emit”Effectively disabled. The default csproj sets <IlcDisableReflection>true</IlcDisableReflection>, which strips reflection metadata during NativeAOT compilation. Emit-style dynamic codegen is fundamentally incompatible with the AOT toolchain.
- If you need limited reflection, set
CCKWasmProjectDescriptor.enableReflection = true. The module size increases significantly.
UnityEngine.GameObject.Find / FindObjectOfType
Section titled “UnityEngine.GameObject.Find / FindObjectOfType”Not generally bound (check GameObjectLinksManual.cs for the subset that is). Even if available they would be forbidden by the scope check: results outside your content root are ScopeContext.ExternalContent and most write operations demand Self.
- Wire references at design time via serialized public fields.
- Use hierarchy traversal from
this.transform(Transform is bound) to find children.
UnityEngine.Instantiate (prefab instantiation)
Section titled “UnityEngine.Instantiate (prefab instantiation)”Restricted. Manual binding in ObjectLinksManual.cs gates instantiation behind scope + permissions. In practice:
- Instantiating a prefab inside your own content root is fine.
- Instantiating into external content (another player’s avatar, the world if you’re an avatar/prop) is rejected.
UnityEngine.Coroutine start
Section titled “UnityEngine.Coroutine start”Partially supported: Coroutine is a type that can be held, but StartCoroutine exposure depends on the GameObjectLinksManual.cs surface. Prefer:
Update/FixedUpdatefor periodic work.- A lightweight state machine you tick yourself rather than multiple coroutines.
Time.deltaTime write
Section titled “Time.deltaTime write”Read is fine (Time is bound). Writes are not accepted — Time.timeScale and similar mutators are either not bound or gated away.
UnityEngine.Application.persistentDataPath / streamingAssetsPath
Section titled “UnityEngine.Application.persistentDataPath / streamingAssetsPath”Not bound. There is no notion of a per-session working directory in the sandbox. Use File Storage.
Any [DllImport] / P/Invoke
Section titled “Any [DllImport] / P/Invoke”Not usable. The generated .wasm has no loadable native libraries — only the WASM imports CVR defines in its linker. P/Invoke declarations compile but fail to link.
Threads / Tasks / async
Section titled “Threads / Tasks / async”- WASM threads — disabled (
WasmManager.Configdoes not setWithWasmThreads). - Task / async — you can use
Taskandasync/awaitat the C# level (the NativeAOT runtime supports it), but all work runs on the WASM single thread. Awaits serialize into continuations on the same call; they do not actually yield to other Unity work. - Thread.Sleep — not bound (there’s nothing to sleep to — you’d block the single thread).
Globalization and culture
Section titled “Globalization and culture”Reflection-dependent culture / formatting APIs may throw or behave unexpectedly under IlcDisableReflection. Stick to invariant-culture formatting and explicit number/date parsers.
Env vars / command line
Section titled “Env vars / command line”WASI environ_get / environ_sizes_get return empty. There is no command line for a WASM module inside CVR.
Summary
Section titled “Summary”| You want to … | Use |
|---|---|
| Read / write a file | File Storage (world, permissioned) |
| Call an HTTP API | CCK WasmModule HTTP helpers, gated by world permissions |
| Move the local player | CVR_LocalPlayer_* (world only) |
| Send data to other clients | Networking |
| Persist state across sessions | File Storage (world) or network-sync with instance owner |
| Read the user’s identity | CVR_Player_GetUserId + AccessUserIdentity permission; CVR_Player_GetUsername no longer needs a permission |
| Load an asset at runtime | Reference it at design time; runtime dynamic loading is forbidden |
| Schedule work on another thread | Not possible — WASM threads disabled |
Related
Section titled “Related”- CVR Host Functions — the full set of what IS exposed.
- Permissions — why something might be exposed yet throw.