コード例 #1
0
 // scene change message will disable transports.
 // kcp processes messages in an internal loop which should be
 // stopped immediately after scene change (= after disabled)
 // => kcp has tests to guaranteed that calling .Pause() during the
 //    receive loop stops the receive loop immediately, not after.
 public override void OnEnable()
 {
     base.OnEnable();
     // unpause when enabled again
     client?.Unpause();
     server?.Unpause();
 }
コード例 #2
0
ファイル: KcpTransport.cs プロジェクト: Will1400/TDGame
 // scene change message will disable transports.
 // kcp processes messages in an internal loop which should be
 // stopped immediately after scene change (= after disabled)
 // => kcp has tests to guaranteed that calling .Pause() during the
 //    receive loop stops the receive loop immediately, not after.
 void OnEnable()
 {
     // unpause when enabled again
     client?.Unpause();
     server?.Unpause();
 }