@@ -278,6 +278,7 @@ private static UdonBehaviour EnsureStaticsHolder(Scene scene, bool undoable)
278278 }
279279 ApplyVisibility ( existing ) ;
280280 ApplySerializedProgram ( existing , program ) ;
281+ PinHolderToNoSync ( existing , undoable ) ;
281282 root . hideFlags = Reveal ? HideFlags . None : HideFlags . HideInHierarchy ;
282283 return existing ;
283284 }
@@ -293,10 +294,30 @@ private static UdonBehaviour EnsureStaticsHolder(Scene scene, bool undoable)
293294 holder . programSource = program ;
294295 ApplyVisibility ( holder ) ;
295296 ApplySerializedProgram ( holder , program ) ;
297+ PinHolderToNoSync ( holder , undoable ) ;
296298 EditorUtility . SetDirty ( holderObject ) ;
297299 return holder ;
298300 }
299301
302+ /// The holder carries no synced variables and never networks — Udon
303+ /// statics are one array per scene, read and written locally. A fresh
304+ /// UdonBehaviour defaults its SyncMethod to Unknown, which the inspector
305+ /// shows as Continuous and asks the network manager for a slot it never
306+ /// uses. Pin it to None. Existing holders are corrected on the next sweep.
307+ private static void PinHolderToNoSync ( UdonBehaviour holder , bool undoable )
308+ {
309+ if ( holder == null || holder . SyncMethod == Networking . SyncType . None )
310+ {
311+ return ;
312+ }
313+ if ( undoable )
314+ {
315+ Undo . RecordObject ( holder , "Set MenSharp statics holder sync mode" ) ;
316+ }
317+ holder . SyncMethod = Networking . SyncType . None ;
318+ EditorUtility . SetDirty ( holder ) ;
319+ }
320+
300321 /// Sets one behaviour-typed public variable, the way TransferValues sets
301322 /// a proxy's fields.
302323 private static void SetBehaviourVariable ( UdonBehaviour udon , string name , UdonBehaviour value )
0 commit comments