Skip to content

Commit 0764197

Browse files
style
Fixing formatting issues.
1 parent db238f5 commit 0764197

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourGenericTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ protected override void OnServerAndClientsCreated()
4141
m_PrefabToSpawn = CreateNetworkObjectPrefab("TestPrefab");
4242
m_PrefabToSpawn.AddComponent<SimpleNetworkBehaviour>();
4343

44-
var childObject = new GameObject
45-
{
46-
name = "ChildObject"
47-
};
44+
var childObject = new GameObject("ChildObject");
4845
childObject.transform.parent = m_PrefabToSpawn.transform;
4946
childObject.AddComponent<NetworkTransform>();
5047
base.OnServerAndClientsCreated();
@@ -147,6 +144,7 @@ public IEnumerator ValidateNoSpam()
147144

148145
// We make an instance of the m_PrefabToSpawn
149146
var validateInstance = Object.Instantiate(m_PrefabToSpawn);
147+
150148
// Then destroy the NetworkObject componwent of that instance.
151149
Object.DestroyImmediate(validateInstance.GetComponent<NetworkObject>());
152150

@@ -161,6 +159,7 @@ public IEnumerator ValidateNoSpam()
161159

162160
simpleNetworkBehaviour.IsSpawned = false;
163161
simpleNetworkBehaviour = null;
162+
164163
// Destroy this test instance
165164
Object.DestroyImmediate(validateInstance);
166165

com.unity.netcode.gameobjects/Tests/Runtime/Prefabs/NetworkPrefabHandlerWithDataTests.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Unity.Netcode.TestHelpers.Runtime;
66
using UnityEngine;
77
using UnityEngine.TestTools;
8+
using Object = UnityEngine.Object;
89

910
namespace 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
}

com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ protected void CreateServerAndClients(int numberOfClients)
794794
{
795795
CreatePlayerPrefab();
796796
}
797-
797+
798798

799799
if (m_EnableTimeTravel)
800800
{

0 commit comments

Comments
 (0)