File tree Expand file tree Collapse file tree
com.unity.netcode.gameobjects/Runtime/NetworkVariable Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,12 +125,17 @@ public virtual void SetDirty(bool isDirty)
125125 }
126126 }
127127
128+ internal static bool IgnoreInitializeWarning ;
129+
128130 protected void MarkNetworkBehaviourDirty ( )
129131 {
130132 if ( m_NetworkBehaviour == null )
131133 {
132- Debug . LogWarning ( $ "NetworkVariable is written to, but doesn't know its NetworkBehaviour yet. " +
133- "Are you modifying a NetworkVariable before the NetworkObject is spawned?" ) ;
134+ if ( ! IgnoreInitializeWarning )
135+ {
136+ Debug . LogWarning ( $ "NetworkVariable is written to, but doesn't know its NetworkBehaviour yet. " +
137+ "Are you modifying a NetworkVariable before the NetworkObject is spawned?" ) ;
138+ }
134139 return ;
135140 }
136141 if ( m_NetworkBehaviour . NetworkManager . ShutdownInProgress )
You can’t perform that action at this time.
0 commit comments