File tree Expand file tree Collapse file tree 4 files changed +5
-9
lines changed Expand file tree Collapse file tree 4 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -109,11 +109,6 @@ private void OnEnable()
109109 if ( _networkedObject == null )
110110 _networkedObject = GetComponentInParent < NetworkedObject > ( ) ;
111111
112- if ( NetworkingManager . singleton != null )
113- CacheAttributedMethods ( ) ;
114- else
115- NetworkingManager . onSingletonSet += CacheAttributedMethods ;
116-
117112 NetworkedObject . NetworkedBehaviours . Add ( this ) ;
118113 }
119114
@@ -124,6 +119,10 @@ private void OnEnable()
124119 public virtual void NetworkStart ( )
125120 {
126121
122+ }
123+ internal void InternalNetworkStart ( )
124+ {
125+ CacheAttributedMethods ( ) ;
127126 }
128127 /// <summary>
129128 /// Gets called when SyncedVars gets updated
Original file line number Diff line number Diff line change @@ -274,6 +274,7 @@ internal void InvokeBehaviourNetworkSpawn()
274274 //We check if we are it's networkedObject owner incase a networkedObject exists as a child of our networkedObject.
275275 if ( ! childNetworkedBehaviours [ i ] . networkedStartInvoked )
276276 {
277+ childNetworkedBehaviours [ i ] . InternalNetworkStart ( ) ;
277278 childNetworkedBehaviours [ i ] . NetworkStart ( ) ;
278279 childNetworkedBehaviours [ i ] . SyncVarInit ( ) ;
279280 childNetworkedBehaviours [ i ] . networkedStartInvoked = true ;
Original file line number Diff line number Diff line change @@ -164,7 +164,6 @@ public bool IsClientConnected
164164 /// An inspector bool that acts as a Trigger for regenerating RSA keys. Should not be used outside Unity editor.
165165 /// </summary>
166166 public bool RegenerateRSAKeys = false ;
167- internal static Action onSingletonSet ;
168167
169168 private void OnValidate ( )
170169 {
@@ -644,8 +643,6 @@ private void OnEnable()
644643 DontDestroyOnLoad ( gameObject ) ;
645644 if ( RunInBackground )
646645 Application . runInBackground = true ;
647-
648- onSingletonSet ( ) ;
649646 }
650647
651648 private void OnDestroy ( )
Original file line number Diff line number Diff line change @@ -91,7 +91,6 @@ public override bool OnRebuildObservers(HashSet<uint> observers)
9191 // The reason it's not cleared is so that you don't have to iterate over your things if you simply
9292 // Have an event driven system where you want to remove a player. Ex if they leave a zone
9393 observers . Clear ( ) ;
94- observers = new HashSet < uint > ( ) ;
9594
9695 if ( ForceHidden )
9796 {
You can’t perform that action at this time.
0 commit comments