File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,17 @@ public NetworkList(IEnumerable<T> values = default,
6060
6161 internal override void OnSpawned ( )
6262 {
63- // If we are dirty and have write permissions by the time the NetworkObject
64- // is finished spawning (same frame) and the instance is on the spawn authority
65- // side, then go ahead and reset the dirty related properties for NetworkList
66- // in the event user script has made changes when spawning to prevent duplicate
67- // entries (i.e. they are sent via CreateObjectMessage so we don't need to send
68- // the NetworkVariableDeltaMessage.
63+ // If the NetworkList is:
64+ // - Dirty
65+ // - State updates can be sent:
66+ // -- The instance has write permissions.
67+ // -- The last sent time plus the max send time period is less than the current time.
68+ // - User script has modified the list during spawn.
69+ // - This instance is on the spawn authority side.
70+ // Then by the time the NetworkObject is finished spawning (on the same frame), then go
71+ // ahead and reset the dirty related properties and last sent time to prevent duplicate
72+ // entries from being sent (i.e. CreateObjectMessage will contain the changes so we
73+ // don't need to send a proceeding NetworkVariableDeltaMessage).
6974 if ( IsDirty ( ) && CanSend ( ) && m_NetworkBehaviour . HasAuthority )
7075 {
7176 UpdateLastSentTime ( ) ;
You can’t perform that action at this time.
0 commit comments