@@ -30,6 +30,11 @@ public sealed class NetworkObject : MonoBehaviour
30
30
// TAIL: DO NOT USE! TEST ONLY TEMP IMPL, WILL BE REMOVED
31
31
32
32
private void OnValidate ( )
33
+ {
34
+ GenerateGlobalObjectIdHash ( ) ;
35
+ }
36
+
37
+ internal void GenerateGlobalObjectIdHash ( )
33
38
{
34
39
// HEAD: DO NOT USE! TEST ONLY TEMP IMPL, WILL BE REMOVED
35
40
if ( TempGlobalObjectIdHashOverride != 0 )
@@ -670,22 +675,22 @@ internal void SerializeSceneObject(NetworkWriter writer, ulong targetClientId)
670
675
// Write placeholder size, NOT as a packed value, initially as zero (i.e. we do not know how much NetworkVariable data will be written yet)
671
676
writer . WriteUInt32 ( 0 ) ;
672
677
673
- // Mark our current position before we potentially write any NetworkVariable data
678
+ // Mark our current position before we potentially write any NetworkVariable data
674
679
var positionBeforeNetworkVariableData = buffer . Position ;
675
680
676
- // Write network variable data
681
+ // Write network variable data
677
682
WriteNetworkVariableData ( buffer , targetClientId ) ;
678
683
679
684
// If our current buffer position is greater than our positionBeforeNetworkVariableData then we wrote NetworkVariable data
680
685
// Part 1: This will include the total NetworkVariable data size, if there was NetworkVariable data written, to the stream
681
686
// in order to be able to skip past this entry on the de-serialization side in the event this NetworkObject fails to be
682
- // constructed (See Part 2 below in the DeserializeSceneObject method)
687
+ // constructed (See Part 2 below in the DeserializeSceneObject method)
683
688
if ( buffer . Position > positionBeforeNetworkVariableData )
684
689
{
685
- // Store our current stream buffer position
690
+ // Store our current stream buffer position
686
691
var endOfNetworkVariableData = buffer . Position ;
687
692
688
- // Calculate the total NetworkVariable data size written
693
+ // Calculate the total NetworkVariable data size written
689
694
var networkVariableDataSize = endOfNetworkVariableData - positionBeforeNetworkVariableData ;
690
695
691
696
// Move the stream position back to just before we wrote our size (we include the unpacked UInt32 data size placeholder)
@@ -742,7 +747,7 @@ internal static NetworkObject DeserializeSceneObject(NetworkBuffer objectStream,
742
747
743
748
if ( networkVariableDataIsIncluded )
744
749
{
745
- // (See Part 1 above in the NetworkObject.SerializeSceneObject method to better understand this)
750
+ // (See Part 1 above in the NetworkObject.SerializeSceneObject method to better understand this)
746
751
// Part 2: This makes sure that if one NetworkObject fails to construct (for whatever reason) then we can "skip past"
747
752
// that specific NetworkObject but continue processing any remaining serialized NetworkObjects as opposed to just
748
753
// throwing an exception and skipping the remaining (if any) NetworkObjects. This will prevent one misconfigured
0 commit comments