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()
109
109
if ( _networkedObject == null )
110
110
_networkedObject = GetComponentInParent < NetworkedObject > ( ) ;
111
111
112
- if ( NetworkingManager . singleton != null )
113
- CacheAttributedMethods ( ) ;
114
- else
115
- NetworkingManager . onSingletonSet += CacheAttributedMethods ;
116
-
117
112
NetworkedObject . NetworkedBehaviours . Add ( this ) ;
118
113
}
119
114
@@ -124,6 +119,10 @@ private void OnEnable()
124
119
public virtual void NetworkStart ( )
125
120
{
126
121
122
+ }
123
+ internal void InternalNetworkStart ( )
124
+ {
125
+ CacheAttributedMethods ( ) ;
127
126
}
128
127
/// <summary>
129
128
/// Gets called when SyncedVars gets updated
Original file line number Diff line number Diff line change @@ -274,6 +274,7 @@ internal void InvokeBehaviourNetworkSpawn()
274
274
//We check if we are it's networkedObject owner incase a networkedObject exists as a child of our networkedObject.
275
275
if ( ! childNetworkedBehaviours [ i ] . networkedStartInvoked )
276
276
{
277
+ childNetworkedBehaviours [ i ] . InternalNetworkStart ( ) ;
277
278
childNetworkedBehaviours [ i ] . NetworkStart ( ) ;
278
279
childNetworkedBehaviours [ i ] . SyncVarInit ( ) ;
279
280
childNetworkedBehaviours [ i ] . networkedStartInvoked = true ;
Original file line number Diff line number Diff line change @@ -164,7 +164,6 @@ public bool IsClientConnected
164
164
/// An inspector bool that acts as a Trigger for regenerating RSA keys. Should not be used outside Unity editor.
165
165
/// </summary>
166
166
public bool RegenerateRSAKeys = false ;
167
- internal static Action onSingletonSet ;
168
167
169
168
private void OnValidate ( )
170
169
{
@@ -644,8 +643,6 @@ private void OnEnable()
644
643
DontDestroyOnLoad ( gameObject ) ;
645
644
if ( RunInBackground )
646
645
Application . runInBackground = true ;
647
-
648
- onSingletonSet ( ) ;
649
646
}
650
647
651
648
private void OnDestroy ( )
Original file line number Diff line number Diff line change @@ -91,7 +91,6 @@ public override bool OnRebuildObservers(HashSet<uint> observers)
91
91
// The reason it's not cleared is so that you don't have to iterate over your things if you simply
92
92
// Have an event driven system where you want to remove a player. Ex if they leave a zone
93
93
observers . Clear ( ) ;
94
- observers = new HashSet < uint > ( ) ;
95
94
96
95
if ( ForceHidden )
97
96
{
You can’t perform that action at this time.
0 commit comments