File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
MLAPI/MonoBehaviours/Core Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ public bool isHost
44
44
45
45
public bool IsClientConnected ;
46
46
public Action OnClientConnectedCallback = null ;
47
+ public Action OnClientDisconnectCallback = null ;
47
48
48
49
public NetworkingConfiguration NetworkConfig ;
49
50
@@ -341,6 +342,8 @@ private void Update()
341
342
}
342
343
else
343
344
{
345
+ if ( OnClientDisconnectCallback != null )
346
+ OnClientDisconnectCallback . Invoke ( ) ;
344
347
IsClientConnected = false ;
345
348
}
346
349
}
@@ -386,7 +389,12 @@ private void Update()
386
389
if ( isServer )
387
390
OnClientDisconnect ( clientId ) ;
388
391
else
392
+ {
393
+ if ( OnClientDisconnectCallback != null )
394
+ OnClientDisconnectCallback . Invoke ( ) ;
395
+
389
396
IsClientConnected = false ;
397
+ }
390
398
break ;
391
399
}
392
400
// Only do another iteration if: there are no more messages AND (there is no limit to max events or we have processed less than the maximum)
You can’t perform that action at this time.
0 commit comments