/* * +-------------------------+ * | Life Cycle | * +-------------------------+ */ public Network() { sessionTcp = new SessionTCP(); sessionTcp.SubscribeNetworkState(OnTcpNodeStateChanged); sessionUdp = new SessionUDP(); sessionUdp.SubscribeNetworkState(OnUdpNodeStateChanged); }
void Awake() { m_sessionTcp = new SessionTCP(); m_sessionTcp.RegisterEventHandler(OnEventHandlingReliable); m_sessionUdp = new SessionUDP(); m_sessionUdp.RegisterEventHandler(OnEventHandlingUnreliable); for (int i = 0; i < m_clientNode.Length; ++i) { m_clientNode[i] = -1; } }