Phase 6 updates

Phase 6 · Slice 13 ·

Corpus: binary files, load order, IMGUI, tilemaps

  • Unity's binary serialization (crates/unity_yaml/src/binary.rs): scenes, prefabs, assets and project settings saved as "Force Binary" (or "Mixed", Unity's default before 2019), format versions 9 to 22, read through their type trees into the same documents as YAML (references {fileID, guid, type}, Unity 5's {first, second} component pairs as component, maps as - key: value). The type trees' common string table was read from the editor's Unity.dll. Unity 5's YAML maps (repeated data: keys) are normalized the same way. RedRunner and GoCube, saved in binary, now load (472 and 75 objects).
  • awake_order (6000.3): a loaded scene's scripts get Awake and OnEnable, then Start, in the file's order (ascending file IDs), not the hierarchy's or the components': scene loads now collect the scripts that become active and wake them by script execution order, then file position. Exports to the editor's JSON form keep it as load_order. Infinity-Rush, whose PlayerShoot.Awake uses what WeaponFx.Awake sets up on the same object, now runs without exceptions.
  • IMGUI: OnGUI with Unity's passes (each input event after a Layout, then Layout and Repaint), drawn over the canvases by GUI.depth; GUI's controls, groups, scroll views and windows; GUILayout (measured in the Layout pass); GUIStyle, GUISkin (a flat built-in skin), GUIUtility. Not recorded: batch mode doesn't run OnGUI. Sample: imgui.json. Space-RPG now compiles and plays.
  • tilemaps (6000.3, the Tilemap module added to the conformance project): Grid layouts (rectangle with gaps, isometric, hexagon, swizzles), Tilemap's tile API (set, fill, swap, bounds, events, per-cell color, transform, flags locking them, collider types), TilemapRenderer (one mesh, a submesh per texture, in the sort order), TilemapCollider2D (grid squares or sprite rectangles), and a saved tilemap (NETilemapScene: m_AllTileFlags keeps TileFlags low and the collider type in the top two bits). Unity's BoxFill does nothing when its position is outside the box; a cell's center excludes the gap. SwampAttack's and Artifact's tilemaps load and draw.
  • text_utilities (6000.3): TextMesh Pro's helpers its example scripts use: TMP_TextUtilities (what's under a point; DistanceToLine is squared), TMPro_EventManager (TEXT_CHANGED_EVENT once per layout, not per redraw), FastAction, TMP_MeshInfo.SwapVertexData and SortGeometry, TMPro_ExtensionMethods (Tint scales alpha too; Compare truncates the difference), TMP_Math. device_info (6000.3): SystemInfo (new) and UnityEngine.Device. Material.SetMatrix and GetMatrix.
  • More from the corpus: BinaryFormatter works (the System.Runtime.Serialization.Formatters package, MIT, behind its AppContext switch; SYSLIB0011 suppressed for scripts), editor-only plugin DLLs in Unity 5's .meta format are left out, plugins with types .NET lacks load their other types, [RuntimeInitializeOnLoadMethod] lookups survive attributes from UnityEditor, generic MonoBehaviour bases with private callbacks use reflection, Unity's built-in UI sprites (UISprite, Background, Knob...) as stand-ins drawn by the engine, textures larger than the GPU allows drawn smaller instead of crashing, scene in corpus/projects.json (RedRunner's build settings name a scene that isn't committed).
  • Corpus: 13 of 14 projects compile (from 9), 13 load a scene. Left: UnityChess needs UI Toolkit and Addressables; BasketBall's TextMesh Pro examples were written for TMP 3.0, whose TMP_MeshInfo.uvs0 is Vector2[] (Unity 6's is Vector4[]); SwampAttack's interface fields are serialized by Odin.
  • Next: animation curves on RectTransform and CanvasGroup; the importer's maxTextureSize; CompositeCollider2D; Odin-serialized fields; UI Toolkit.