Skip to content

Commit cbdf84d

Browse files
committed
[增加]1. 增加网络激活状态变化事件
1 parent 9bc3aba commit cbdf84d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Runtime/Network/Network/NetworkManager.NetworkChannelBase.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ protected bool PActive
6161
get { return m_PActive; }
6262
set
6363
{
64+
if (m_PActive == value)
65+
{
66+
return;
67+
}
68+
6469
m_PActive = value;
65-
Log.Debug(value);
70+
NetworkChannelActiveChanged?.Invoke(this, m_PActive);
6671
}
6772
}
6873

@@ -75,6 +80,7 @@ protected bool PActive
7580

7681
public Action<NetworkChannelBase, object> NetworkChannelConnected;
7782
public Action<NetworkChannelBase> NetworkChannelClosed;
83+
public Action<NetworkChannelBase, bool> NetworkChannelActiveChanged;
7884
public Action<NetworkChannelBase, int> NetworkChannelMissHeartBeat;
7985
public Action<NetworkChannelBase, NetworkErrorCode, SocketError, string> NetworkChannelError;
8086
public Action<NetworkChannelBase, object> NetworkChannelCustomError;

0 commit comments

Comments
 (0)