Skip to content

fix Dead code in unityCanvasCount keeps canvas ID unchanged#589

Open
xytczh wants to merge 1 commit into
jeffreylanters:mainfrom
xytczh:fix-unityCanvasCount
Open

fix Dead code in unityCanvasCount keeps canvas ID unchanged#589
xytczh wants to merge 1 commit into
jeffreylanters:mainfrom
xytczh:fix-unityCanvasCount

Conversation

@xytczh

@xytczh xytczh commented Jun 24, 2026

Copy link
Copy Markdown

unityCanvasCount is a module-level variable that is never incremented. Since useMemo relies on this permanently zero value, refreshCanvasId() always returns "react-unity-webgl-canvas-0". This causes multiple Unity instances to share the same canvas ID, potentially causing internal Unity conflicts.

@xytczh
xytczh requested a review from jeffreylanters as a code owner June 24, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant