22using System . Text ;
33using Unity . Netcode ;
44using Unity . Netcode . TestHelpers . Runtime ;
5- using UnityEditor ;
65using UnityEngine ;
76using UnityEngine . TestTools ;
87
98namespace DocumentationCodeSamples
109{
1110 internal static class FastBufferExtensions
1211 {
13- internal static void WriteValueSafe ( this FastBufferWriter writer , in TestSerializationDocs . Health health )
12+ internal static void WriteValueSafe ( this FastBufferWriter writer , in CustomSerializationDocsTests . Health health )
1413 {
1514 writer . WriteValueSafe ( health . MaxHealth ) ;
1615 writer . WriteValueSafe ( health . CurrentHealth ) ;
1716 }
1817
19- internal static void ReadValueSafe ( this FastBufferReader reader , out TestSerializationDocs . Health health )
18+ internal static void ReadValueSafe ( this FastBufferReader reader , out CustomSerializationDocsTests . Health health )
2019 {
2120 reader . ReadValueSafe ( out uint max ) ;
2221 reader . ReadValueSafe ( out int current ) ;
23- health = new TestSerializationDocs . Health { MaxHealth = max , CurrentHealth = current } ;
22+ health = new CustomSerializationDocsTests . Health { MaxHealth = max , CurrentHealth = current } ;
2423 }
2524 }
2625
2726
28- internal class TestSerializationDocs : NetcodeIntegrationTest
27+ internal class CustomSerializationDocsTests : NetcodeIntegrationTest
2928 {
3029 #region HealthExample
3130
@@ -35,7 +34,7 @@ public struct Health
3534 public int CurrentHealth ;
3635
3736 // Register our custom serialization on load
38- [ InitializeOnLoadMethod ]
37+ [ RuntimeInitializeOnLoadMethod ]
3938 public static void RegisterHealthSerialization ( )
4039 {
4140 // You can reuse the FastBufferWriter and FastBufferReader extension methods we wrote above
0 commit comments