Script Validator
TL;DR: Paste a C# script; the validator resolves variable types from declarations, looks up every expr.Method(...) / Type.Method(...) call against a symbol table extracted from the current CCK stubs, and reports unknown types, unknown methods, forbidden namespaces, disallowed events, base-class errors, and context violations. No real compile, no Unity DLLs shipped — this is a static symbol-level check.
The symbol table comes from assets/bindings.json, regenerated from the live decompile.
What the validator does
Section titled “What the validator does”- Fetches
/assets/bindings.jsonon load. The payload includes:- Bound UnityEngine / TMPro type names (~280).
- Full CCK author-facing types with method and property signatures (~40 types, ~180 methods, ~70 properties).
- Host function names, allowed/disallowed events, forbidden namespaces and types.
- Syntax pass — a state-machine walk over the raw source that tracks strings, verbatim strings, interpolated strings, character literals, line comments, block comments, and the
{}/()/[]stack. Reports:- Unclosed
{,(,[(with the opening position). - Unexpected / mismatched closers.
- Unterminated string, interpolated string, char, or block comment.
- Unclosed
- Parses your script to build:
- Using directives.
- Class declarations and their base types.
- Fields with declared types.
- Local variables inside each method.
- Method-call expressions.
- Validates each call against the CCK symbol table:
- Known static class + unknown method → error, with a closest-match suggestion.
- Known instance variable type + unknown method → error.
- Unknown type in a field or variable declaration → warning.
- Forbidden namespace / type usage, disallowed Unity event, wrong base class, world-only API from wrong context,
[DllImport], reflection hazards, TMP_InputField / UI.Button surface gaps, private transient fields without[WasmSerialized]— all flagged.
Limitations
Section titled “Limitations”- Not a real compiler. No type inference beyond direct declarations, no generic substitution, no extension methods, no overload resolution, no inheritance lookup across types.
- UnityEngine methods aren’t signature-checked. The binder surface knows which types are bound but not their method shapes, so
transform.SetPositionAndRotation(p, r)is accepted without argument-count validation. varinference handlesvar x = Type.Method(...)by looking up the method’s return type; anything more complex (LINQ chains, casts) falls back to “unknown”.this/ base-class access isn’t resolved. Calls throughthis.transformare assumed valid.
These trade-offs keep the validator zero-dependency and instant while still catching most real sandbox mistakes.
URL parameter
Section titled “URL parameter”Deep-link to a specific example via ?example=<key>. Keys match the dropdown: hello, counter, animator, notepad, netcounter, clicker, idle, visual-novel, turn-based, rpg, networked-rpg, avatar-toggle, prop-dice, bad. Avatar and prop examples also pre-select the matching context.
Example: /wasm/validator/?example=rpg opens the validator pre-loaded with the single-player RPG scaffold.