Repository navigation
fix: four components hide ArenaComponent.Update(), dropping repeat attribute messages - #238
Draft
claude[bot] wants to merge 1 commit into
Draft
claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
ArenaClickListener, ArenaMaterialExtras, ArenaModelUpdate and ArenaGltfMorph declared "private new void Update()", hiding the base ArenaComponent.Update() that is the only caller of ApplyRender(). Unity dispatched only the derived method, so the *Applied latch was never cleared and the second and later inbound material-extras, modelUpdate and gltf-morph messages were dropped. Each now overrides Update() and calls base.Update() first, keeping its own per-frame work unchanged. ArenaClickListener.ApplyRender(), which this makes reachable, no longer throws NotImplementedException; it warns once per inbound message when a non-default enabled/bubble is requested. Closes #220
claude Bot
pushed a commit
that referenced
this pull request
Aug 27, 2026
`json.ColorWrite` is never read anywhere in the package. The only `_ColorWriteMask` writes (ArenaMaterialExtras.cs:105-106) are gated on `json.TransparentOccluder`, a different property, so `colorWrite` on the wire is silently ignored. This marker was deferred to a sibling PR, but no open PR corrects it: #238's only hunk in this file converts `private new void Update()` to `protected override void Update()` and leaves the status block untouched. Correcting it here so #227 does not auto-close with a known-wrong marker. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013e7rG6DQLvDnk8jumh9DJF
claude
Bot
force-pushed
the
fix/component-update-hiding
branch
from
August 27, 2026 18:10
261c7e5 to
3676161
Compare
claude Bot
pushed a commit
that referenced
this pull request
Aug 27, 2026
`json.ColorWrite` is never read anywhere in the package. The only `_ColorWriteMask` writes (ArenaMaterialExtras.cs:105-106) are gated on `json.TransparentOccluder`, a different property, so `colorWrite` on the wire is silently ignored. This marker was deferred to a sibling PR, but no open PR corrects it: #238's only hunk in this file converts `private new void Update()` to `protected override void Update()` and leaves the status block untouched. Correcting it here so #227 does not auto-close with a known-wrong marker.
claude
Bot
force-pushed
the
fix/component-update-hiding
branch
from
August 27, 2026 18:26
3676161 to
dee6316
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by mwfarb · Slack thread
Before: you drop a
material-extras,modelUpdateorgltf-morphattribute on an object and the first message applies. Send a second message changing the same attribute on the same object and nothing happens in the Editor — the object keeps the values from the first message forever. AnoverrideSrctexture that had not finished downloading on the first pass never appears either, even after the file lands on disk.After: the second and every later message applies. Change
gltfOpacityfrom1.0to0.3, move a bone twice withmodelUpdate, drive a morph target repeatedly — each message now reachesApplyRender()instead of being dropped. A texture that arrives late is picked up on the retry instead of being ignored. One limit worth stating plainly: a repeat message withgltfOpacity: 1.0is now processed, but it does not restore the object's opacity. Every transparency mutation sits inside theif (json.GltfOpacity < 1f)gate atArenaMaterialExtras.cs:54-92, which has noelsebranch, so the material stays translucent. Restoring opacity requires that missingelsebranch to undo the shader swap, blend modes, keywords and render queue; this PR does not add it.ArenaClickListener,ArenaMaterialExtras,ArenaModelUpdateandArenaGltfMorpheach declaredprivate new void Update(), which hidesArenaComponent.Update()(Runtime/Components/ArenaComponent.cs:25-32) rather than extending it. That base method is the only caller ofApplyRender(), and Unity dispatches oneUpdateper MonoBehaviour, so the base never ran: the*Appliedlatch set on the first pass was never cleared, and the one asset-arrival retry that setsapply = true(ArenaMaterialExtras.cs:117) was dead code.How: the base
Update()was alreadyprotected virtual, so each of the four now declaresprotected override void Update()and callsbase.Update()as its first statement, keeping its own per-frame work byte-for-byte unchanged. This matches the existing idiom atRuntime/ArenaClientScene.cs:354. Calling the base first means the latch is cleared and the work redone in the same frame the message arrives, rather than one frame later. After this change, nonew void Update/Start/OnValidateremains anywhere inRuntime/orEditor/.The reachable throw.
ArenaClickListener.ApplyRender()was the package's onlythrow new System.NotImplementedException(), unreachable precisely becauseApplyRender()never ran; this change makes an inboundclick-listenermessage reach it. I chose the warning, not an implementation, because neither field is a one-liner with an obvious meaning:enabled("Publish events, set false to disable") could reasonably mean stop publishing, stop building colliders, or disable the component, andbubblehas no direct Unity analogue — Unity does not propagate mouse events to scene-graph parents, andArenaClickListenerModel.ForwardEvent()walks up to the nearest ancestor listener, so the Unity side already behaves closer tobubble: falsethan to the schema default oftrue. Guessing here would be a behaviour change the maintainer has not asked for. SoApplyRender()now logs a singleDebug.LogWarningnaming both fields, and only when the scene actually asks for a non-default value, so ordinaryclick-listenerobjects stay silent. The stale// DONE: enabledline in the conversion-status header was corrected to// TODO: enabledto match.Closes #220
How to test in the Editor
gltf-modelobject that hasmaterial-extras.arena-py), sendmaterial-extraswithgltfOpacity: 0.3to that object. Confirm it goes translucent — this already worked before.material-extrasto the same object withgltfOpacity: 1.0. Before this PR the message was dropped entirely; it should now be processed — confirm via the retry path that the message is handled at all. It will not go opaque again: theif (json.GltfOpacity < 1f)gate atArenaMaterialExtras.cs:54-92has noelsebranch, so nothing reverts the transparency settings. That else-branch is not part of this PR.modelUpdate: send two consecutive messages moving/rotating the same named bone to two different values, and confirm the second one lands.gltf-morph: send twovalueupdates for onemorphtargetand confirm the second weight applies.overrideSrcretry: sendmaterial-extraswith anoverrideSrcURL that is not cached locally yet. The texture should appear once the asset download completes, without a further message.click-listenerregression: add aclick-listenerobject and confirm clicks still publishmousedown/mouseup/mouseenter/mouseleaveclientEvents, that colliders are still built for both primitives and gltf models, and that no exception is thrown. Withenabled: falseorbubble: falseyou should see one warning line per message instead of a crash.Untested
This is untested. There is no Unity Editor and no Unity licence in the environment this was written in, and no CI will run on this PR — the workflow that adds
pull_requesttriggers exists only in unmerged draft PR #183, and thedotnet testproject underTests~/DotNet/is likewise not onmain(and links only UnityEngine-free sources, so it could not cover this anyway). Nothing here has been compiled. Please treat the Editor steps above as the actual verification.Notes for review
ApplyRender()re-running for these four components (repeat-message handling, asset-arrival retries) cannot be seen working until this lands.ArenaMaterialExtras's per-frame work is not idempotent —material.renderQueue += (int)json.RenderOrder(ArenaMaterialExtras.cs:99) adds to the current queue rather than setting it. Onmainthis was harmless only because the repeat message was dropped, so the queue never moved after the first pass. WithApplyRender()now re-running, a non-1.0renderOrderclimbs byrenderOrderon every inbound message and every Inspector edit — specifically whengltfOpacity >= 1andtransparentOccluderis false, since those are the two paths that would otherwise reset the queue to a fixed value (3000 and 1999). This is a regression introduced by this PR, not a pre-existing quirk. Fixing it needs a decision I do not want to make inside this diff — snapshot the pristine queue per material and add to that, or anchor the addition tomaterial.shader.renderQueue— so it is deliberately left for a follow-up and should get its own issue..metafiles, no reformatting, no autogenerated schema files touched.Generated by Claude Code