55using Unity . Netcode . TestHelpers . Runtime ;
66using UnityEngine ;
77using UnityEngine . TestTools ;
8+ using Object = UnityEngine . Object ;
89
910namespace Unity . Netcode . RuntimeTests
1011{
@@ -73,8 +74,6 @@ public IEnumerator InstantiationPayload_LateJoinersReceiveData()
7374 yield return WaitForSpawnedOnAllOrTimeOut ( spawned ) ;
7475 AssertOnTimeout ( $ "Not all clients spawned { spawned . name } !") ;
7576
76-
77-
7877 // When running with Distributed Authority, test a late-joiner after an ownership change
7978 // The object owner will synchronize the late joining client, showing that the instantiationData will survive host migration.
8079 if ( m_DistributedAuthority )
@@ -111,8 +110,8 @@ private void RegisterPrefabHandler(NetworkManager manager, out PrefabInstanceHan
111110 private NetworkObject SpawnPrefabWithData ( NetworkSerializableTest data )
112111 {
113112 var authority = GetAuthorityNetworkManager ( ) ;
114- var instance = UnityEngine . Object . Instantiate ( m_Prefab ) . GetComponent < NetworkObject > ( ) ;
115-
113+ var instance = Object . Instantiate ( m_Prefab ) . GetComponent < NetworkObject > ( ) ;
114+
116115 GetAuthorityNetworkManager ( ) . PrefabHandler . SetInstantiationData ( instance , data ) ;
117116
118117 SpawnObjectInstance ( instance , authority ) ;
@@ -137,12 +136,12 @@ public PrefabInstanceHandlerWithData(GameObject prefab)
137136 public override NetworkObject Instantiate ( ulong ownerClientId , Vector3 position , Quaternion rotation , NetworkSerializableTest data )
138137 {
139138 InstantiationData = data ;
140- return UnityEngine . Object . Instantiate ( m_Prefab , position , rotation ) . GetComponent < NetworkObject > ( ) ;
139+ return Object . Instantiate ( m_Prefab , position , rotation ) . GetComponent < NetworkObject > ( ) ;
141140 }
142141
143142 public override void Destroy ( NetworkObject networkObject )
144143 {
145- UnityEngine . Object . DestroyImmediate ( networkObject . gameObject ) ;
144+ Object . DestroyImmediate ( networkObject . gameObject ) ;
146145 }
147146 }
148147
@@ -158,7 +157,9 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade
158157 }
159158
160159 public bool IsSynchronizedWith ( NetworkSerializableTest other )
161- => Value == other . Value && Math . Abs ( Value2 - other . Value2 ) < 0.0001f ;
160+ {
161+ return Value == other . Value && Math . Abs ( Value2 - other . Value2 ) < 0.0001f ;
162+ }
162163 }
163164 }
164165}
0 commit comments