Skip to content

Commit 2aa38ce

Browse files
update
Missed update
1 parent 7904e3d commit 2aa38ce

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)