@@ -24,6 +24,18 @@ public class NetworkTransform : NetworkBehaviour
2424 [ HideInInspector ]
2525 [ SerializeField ]
2626 internal bool NetworkTransformExpanded ;
27+
28+ [ RuntimeInitializeOnLoadMethod ( RuntimeInitializeLoadType . SubsystemRegistration ) ]
29+ private static void ResetStaticsOnLoad ( )
30+ {
31+ CurrentTick = 0 ;
32+ TrackStateUpdateId = false ;
33+ AssignDefaultInterpolationType = false ;
34+ DefaultInterpolationType = default ;
35+ s_NetworkTickRegistration = new Dictionary < NetworkManager , NetworkTransformTickRegistration > ( ) ;
36+ InterpolationBufferTickOffset = 0 ;
37+ s_TickSynchPosition = 0 ;
38+ }
2739#endif
2840
2941 internal enum Axis { X , Y , Z }
@@ -4767,21 +4779,6 @@ public NetworkTransformTickRegistration(NetworkManager networkManager)
47674779 }
47684780 }
47694781 }
4770- private static int s_TickSynchPosition ;
4771-
4772- #if UNITY_EDITOR
4773- [ RuntimeInitializeOnLoadMethod ( RuntimeInitializeLoadType . SubsystemRegistration ) ]
4774- private static void ResetStaticsOnLoad ( )
4775- {
4776- CurrentTick = 0 ;
4777- TrackStateUpdateId = false ;
4778- AssignDefaultInterpolationType = false ;
4779- DefaultInterpolationType = default ;
4780- s_NetworkTickRegistration = new Dictionary < NetworkManager , NetworkTransformTickRegistration > ( ) ;
4781- InterpolationBufferTickOffset = 0 ;
4782- s_TickSynchPosition = 0 ;
4783- }
4784- #endif
47854782
47864783 private int m_NextTickSync ;
47874784
0 commit comments