Skip to content

Commit e37263e

Browse files
chore: standards check formatting
What the CI standards job's own --fix pass produced. .editorconfig has dotnet_style_null_propagation and dotnet_style_coalesce_expression at error, so the two null ternaries had to go. Both are safe against Unity's == overload: InvokeBehaviourOnNetworkObjectParentChanged passes either a literal null or a spawned object whose transform it has already dereferenced, and SpawnMover is only ever called with no prefab or a real one. NativeInterpolatorTests no longer uses anything from System.
1 parent c737a43 commit e37263e

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4260,7 +4260,7 @@ internal override void InternalOnNetworkObjectParentChanged(NetworkObject parent
42604260
}
42614261

42624262
// Handle transform space re-parenting transitions for batched transforms.
4263-
ConvertBatchedInterpolationSpace(m_PositionInterpolator.Parent, parentNetworkObject != null ? parentNetworkObject.transform : null);
4263+
ConvertBatchedInterpolationSpace(m_PositionInterpolator.Parent, parentNetworkObject?.transform);
42644264

42654265
InLocalSpace = parentNetworkObject != null;
42664266

com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NativeInterpolatorTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using NUnit.Framework;
32
using Unity.Collections;
43
using Unity.Mathematics;

com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformSyncModeParityTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected override IEnumerator OnTearDown()
100100
/// </summary>
101101
private NetworkObject SpawnMover(ulong ownerClientId = NetworkManager.ServerClientId, GameObject prefab = null)
102102
{
103-
var instance = Object.Instantiate(prefab != null ? prefab : m_MoverPrefab);
103+
var instance = Object.Instantiate(prefab ?? m_MoverPrefab);
104104
var networkObject = instance.GetComponent<NetworkObject>();
105105
networkObject.NetworkManagerOwner = m_ServerNetworkManager;
106106
networkObject.SpawnWithOwnership(ownerClientId);

0 commit comments

Comments
 (0)