mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
合理化框架
合理化框架
This commit is contained in:
@@ -70,7 +70,7 @@ namespace TEngine
|
||||
public void CreateSession(string remoteAddress, NetworkProtocolType networkProtocolType, Action onConnectComplete, Action onConnectFail, int connectTimeout = 5000)
|
||||
{
|
||||
var address = NetworkHelper.ToIPEndPoint(remoteAddress);
|
||||
var clientNetworkComponent = AddComponent<ClientNetworkComponent>();
|
||||
var clientNetworkComponent = GetComponent<ClientNetworkComponent>() ?? AddComponent<ClientNetworkComponent>();
|
||||
clientNetworkComponent.Initialize(networkProtocolType, NetworkTarget.Outer);
|
||||
clientNetworkComponent.Connect(address, onConnectComplete, onConnectFail, connectTimeout);
|
||||
Session = clientNetworkComponent.Session;
|
||||
|
Reference in New Issue
Block a user