@@ -191,59 +191,59 @@ internal static void HandleSpawnPoolObject(uint clientId, BitReader reader, int
191191 float yRot = reader . ReadFloat ( ) ;
192192 float zRot = reader . ReadFloat ( ) ;
193193
194- SpawnManager . spawnedObjects [ netId ] . transform . position = new Vector3 ( xPos , yPos , zPos ) ;
195- SpawnManager . spawnedObjects [ netId ] . transform . rotation = Quaternion . Euler ( xRot , yRot , zRot ) ;
196- SpawnManager . spawnedObjects [ netId ] . gameObject . SetActive ( true ) ;
194+ SpawnManager . SpawnedObjects [ netId ] . transform . position = new Vector3 ( xPos , yPos , zPos ) ;
195+ SpawnManager . SpawnedObjects [ netId ] . transform . rotation = Quaternion . Euler ( xRot , yRot , zRot ) ;
196+ SpawnManager . SpawnedObjects [ netId ] . gameObject . SetActive ( true ) ;
197197 }
198198
199199 internal static void HandleDestroyPoolObject ( uint clientId , BitReader reader , int channelId )
200200 {
201201 uint netId = reader . ReadUInt ( ) ;
202- SpawnManager . spawnedObjects [ netId ] . gameObject . SetActive ( false ) ;
202+ SpawnManager . SpawnedObjects [ netId ] . gameObject . SetActive ( false ) ;
203203 }
204204
205205 internal static void HandleChangeOwner ( uint clientId , BitReader reader , int channelId )
206206 {
207207 uint netId = reader . ReadUInt ( ) ;
208208 uint ownerClientId = reader . ReadUInt ( ) ;
209- if ( SpawnManager . spawnedObjects [ netId ] . OwnerClientId == netManager . LocalClientId )
209+ if ( SpawnManager . SpawnedObjects [ netId ] . OwnerClientId == netManager . LocalClientId )
210210 {
211211 //We are current owner.
212- SpawnManager . spawnedObjects [ netId ] . InvokeBehaviourOnLostOwnership ( ) ;
212+ SpawnManager . SpawnedObjects [ netId ] . InvokeBehaviourOnLostOwnership ( ) ;
213213 }
214214 if ( ownerClientId == netManager . LocalClientId )
215215 {
216216 //We are new owner.
217- SpawnManager . spawnedObjects [ netId ] . InvokeBehaviourOnGainedOwnership ( ) ;
217+ SpawnManager . SpawnedObjects [ netId ] . InvokeBehaviourOnGainedOwnership ( ) ;
218218 }
219- SpawnManager . spawnedObjects [ netId ] . OwnerClientId = ownerClientId ;
219+ SpawnManager . SpawnedObjects [ netId ] . OwnerClientId = ownerClientId ;
220220 }
221221
222222 internal static void HandleSyncVarUpdate ( uint clientId , BitReader reader , int channelId )
223223 {
224224 uint netId = reader . ReadUInt ( ) ;
225225 ushort orderIndex = reader . ReadUShort ( ) ;
226226
227- if ( ! SpawnManager . spawnedObjects . ContainsKey ( netId ) )
227+ if ( ! SpawnManager . SpawnedObjects . ContainsKey ( netId ) )
228228 {
229229 if ( LogHelper . CurrentLogLevel <= LogLevel . Normal ) LogHelper . LogWarning ( "Sync message recieved for a non existant object with id: " + netId ) ;
230230 return ;
231231 }
232- else if ( SpawnManager . spawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) == null )
232+ else if ( SpawnManager . SpawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) == null )
233233 {
234234 if ( LogHelper . CurrentLogLevel <= LogLevel . Normal ) LogHelper . LogWarning ( "Sync message recieved for a non existant behaviour" ) ;
235235 return ;
236236 }
237237
238- for ( int i = 0 ; i < SpawnManager . spawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) . syncedVarFields . Count ; i ++ )
238+ for ( int i = 0 ; i < SpawnManager . SpawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) . syncedVarFields . Count ; i ++ )
239239 {
240240 if ( ! reader . ReadBool ( ) )
241241 continue ;
242- SyncedVarField field = SpawnManager . spawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) . syncedVarFields [ i ] ;
243- SpawnManager . spawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) . OnSyncVarUpdate ( FieldTypeHelper . ReadFieldType ( reader ,
242+ SyncedVarField field = SpawnManager . SpawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) . syncedVarFields [ i ] ;
243+ SpawnManager . SpawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) . OnSyncVarUpdate ( FieldTypeHelper . ReadFieldType ( reader ,
244244 field . FieldInfo . FieldType , field . FieldValue ) , i ) ;
245245 }
246- SpawnManager . spawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) . OnSyncVarUpdate ( ) ;
246+ SpawnManager . SpawnedObjects [ netId ] . GetBehaviourAtOrderIndex ( orderIndex ) . OnSyncVarUpdate ( ) ;
247247 }
248248
249249 internal static void HandleAddObjects ( uint clientId , BitReader reader , int channelId )
@@ -299,7 +299,7 @@ internal static void HandleCommand(uint clientId, BitReader reader, int channelI
299299 uint networkId = reader . ReadUInt ( ) ;
300300 ushort orderId = reader . ReadUShort ( ) ;
301301 ulong hash = reader . ReadULong ( ) ;
302- NetworkedBehaviour behaviour = SpawnManager . spawnedObjects [ networkId ] . GetBehaviourAtOrderIndex ( orderId ) ;
302+ NetworkedBehaviour behaviour = SpawnManager . SpawnedObjects [ networkId ] . GetBehaviourAtOrderIndex ( orderId ) ;
303303 if ( clientId != behaviour . OwnerClientId )
304304 return ; // Not owner
305305 MethodInfo targetMethod = null ;
@@ -321,7 +321,7 @@ internal static void HandleRpc(uint clientId, BitReader reader, int channelId)
321321 uint networkId = reader . ReadUInt ( ) ;
322322 ushort orderId = reader . ReadUShort ( ) ;
323323 ulong hash = reader . ReadULong ( ) ;
324- NetworkedBehaviour behaviour = SpawnManager . spawnedObjects [ networkId ] . GetBehaviourAtOrderIndex ( orderId ) ;
324+ NetworkedBehaviour behaviour = SpawnManager . SpawnedObjects [ networkId ] . GetBehaviourAtOrderIndex ( orderId ) ;
325325 MethodInfo targetMethod = null ;
326326 if ( behaviour . cachedMethods . ContainsKey ( hash ) )
327327 targetMethod = behaviour . cachedMethods [ hash ] ;
@@ -341,7 +341,7 @@ internal static void HandleTargetRpc(uint clientId, BitReader reader, int channe
341341 uint networkId = reader . ReadUInt ( ) ;
342342 ushort orderId = reader . ReadUShort ( ) ;
343343 ulong hash = reader . ReadULong ( ) ;
344- NetworkedBehaviour behaviour = SpawnManager . spawnedObjects [ networkId ] . GetBehaviourAtOrderIndex ( orderId ) ;
344+ NetworkedBehaviour behaviour = SpawnManager . SpawnedObjects [ networkId ] . GetBehaviourAtOrderIndex ( orderId ) ;
345345 MethodInfo targetMethod = null ;
346346 if ( behaviour . cachedMethods . ContainsKey ( hash ) )
347347 targetMethod = behaviour . cachedMethods [ hash ] ;
@@ -358,8 +358,8 @@ internal static void HandleSetVisibility(uint clientId, BitReader reader, int ch
358358 uint networkId = reader . ReadUInt ( ) ;
359359 bool visibility = reader . ReadBool ( ) ;
360360 if ( visibility )
361- SpawnManager . spawnedObjects [ networkId ] . SetFormattedSyncedVarData ( reader ) ;
362- SpawnManager . spawnedObjects [ networkId ] . SetLocalVisibility ( visibility ) ;
361+ SpawnManager . SpawnedObjects [ networkId ] . SetFormattedSyncedVarData ( reader ) ;
362+ SpawnManager . SpawnedObjects [ networkId ] . SetLocalVisibility ( visibility ) ;
363363 }
364364 }
365365}
0 commit comments