Skip to content

Commit 02db2bc

Browse files
update
Reverting some changes. Adding NETCODE_UAC1001_CHECKS (for now) wrapped [Serializable] decorations to anything that is public and not already considered serializable.
1 parent f10b0c3 commit 02db2bc

File tree

18 files changed

+74
-30
lines changed

18 files changed

+74
-30
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Runtime.CompilerServices;
23
using Unity.Mathematics;
34
using UnityEngine;
@@ -12,6 +13,9 @@ namespace Unity.Netcode.Components
1213
/// individual axis and the 16 bits of the half float are stored as <see cref="ushort"/> values since C# does not have
1314
/// a half float type.
1415
/// </remarks>
16+
#if NETCODE_UAC1001_CHECKS
17+
[Serializable]
18+
#endif
1519
public struct HalfVector3 : INetworkSerializable
1620
{
1721
internal const int Length = 3;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Runtime.CompilerServices;
23
using Unity.Mathematics;
34
using UnityEngine;
@@ -12,6 +13,9 @@ namespace Unity.Netcode.Components
1213
/// individual axis and the 16 bits of the half float are stored as <see cref="ushort"/> values since C# does not have
1314
/// a half float type.
1415
/// </remarks>
16+
#if NETCODE_UAC1001_CHECKS
17+
[Serializable]
18+
#endif
1519
public struct HalfVector4 : INetworkSerializable
1620
{
1721
internal const int Length = 4;

com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ namespace Unity.Netcode
1010
/// Partially solves for message loss. Unclamped lerping helps hide this, but not completely
1111
/// </summary>
1212
/// <typeparam name="T">The type of interpolated value</typeparam>
13+
#if NETCODE_UAC1001_CHECKS
14+
[Serializable]
15+
#endif
1316
public abstract class BufferedLinearInterpolator<T> where T : struct
1417
{
1518
// Constant absolute value for max buffer count instead of dynamic time based value. This is in case we have very low tick rates, so

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Runtime.CompilerServices;
23
using Unity.Mathematics;
34
using UnityEngine;
@@ -7,6 +8,9 @@ namespace Unity.Netcode.Components
78
/// <summary>
89
/// Used to synchromnize delta position when half float precision is enabled
910
/// </summary>
11+
#if NETCODE_UAC1001_CHECKS
12+
[Serializable]
13+
#endif
1014
public struct NetworkDeltaPosition : INetworkSerializable
1115
{
1216
internal const float MaxDeltaBeforeAdjustment = 64f;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if COM_UNITY_MODULES_PHYSICS
2+
using System;
23
using System.Collections.Generic;
34
using Unity.Collections;
45
using Unity.Jobs;
@@ -11,6 +12,9 @@ namespace Unity.Netcode.Components
1112
/// Information a <see cref="Rigidbody"/> returns to <see cref="RigidbodyContactEventManager"/> via <see cref="IContactEventHandlerWithInfo.GetContactEventHandlerInfo"/> <br />
1213
/// if the <see cref="Rigidbody"/> registers itself with <see cref="IContactEventHandlerWithInfo"/> as opposed to <see cref="IContactEventHandler"/>.
1314
/// </summary>
15+
#if NETCODE_UAC1001_CHECKS
16+
[Serializable]
17+
#endif
1418
public struct ContactEventHandlerInfo
1519
{
1620
/// <summary>

com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ namespace Unity.Netcode
1010
/// </summary>
1111
/// <typeparam name="T">The type for the list</typeparam>
1212
[GenerateSerializationForGenericParameter(0)]
13+
#if NETCODE_UAC1001_CHECKS
14+
[Serializable]
15+
#endif
1316
public class NetworkList<T> : NetworkVariableBase where T : unmanaged, IEquatable<T>
1417
{
1518
private NativeList<T> m_List = new NativeList<T>(64, Allocator.Persistent);

com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ public class SceneEvent
144144
/// Main class for managing network scenes when <see cref="NetworkConfig.EnableSceneManagement"/> is enabled.
145145
/// Uses the <see cref="SceneEventMessage"/> message to communicate <see cref="SceneEventData"/> between the server and client(s)
146146
/// </summary>
147+
#if NETCODE_UAC1001_CHECKS
148+
[Serializable]
149+
#endif
147150
public class NetworkSceneManager : IDisposable
148151
{
149152
internal const int InvalidSceneNameOrPath = -1;

com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ namespace Unity.Netcode
1111
/// <summary>
1212
/// Class that handles object spawning
1313
/// </summary>
14+
#if NETCODE_UAC1001_CHECKS
15+
[Serializable]
16+
#endif
1417
public class NetworkSpawnManager
1518
{
1619
// Stores the objects that need to be shown at end-of-frame

com.unity.netcode.gameobjects/Runtime/Timing/NetworkTickSystem.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ namespace Unity.Netcode
77
/// Provides discretized time.
88
/// This is useful for games that require ticks happening at regular interval on the server and clients.
99
/// </summary>
10+
#if NETCODE_UAC1001_CHECKS
11+
[Serializable]
12+
#endif
1013
public class NetworkTickSystem
1114
{
1215
#if DEVELOPMENT_BUILD || UNITY_EDITOR

com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ namespace Unity.Netcode
99
/// Time is stored as a combination of amount of passed ticks + a duration offset.
1010
/// This struct is meant to replace the Unity <see cref="Time"/> API for multiplayer gameplay.
1111
/// </summary>
12+
#if NETCODE_UAC1001_CHECKS
13+
[Serializable]
14+
#endif
1215
public struct NetworkTime
1316
{
1417
private double m_TimeSec;

0 commit comments

Comments
 (0)